diff --git a/ajax/sessionController.php b/ajax/sessionController.php index 73f1c6cb..c07bcc9b 100644 --- a/ajax/sessionController.php +++ b/ajax/sessionController.php @@ -101,7 +101,7 @@ class SessionController extends Controller{ if ($view->file_exists($path)){ $currentHash = sha1($view->file_get_contents($path)); - if ($currentHash !== $sessionData['genesis_hash']){ + if (!Helper::isVersionsEnabled() && $currentHash !== $sessionData['genesis_hash']){ // Original file was modified externally. Save to a new one $path = Helper::getNewFileName($view, $path, '-conflict'); } diff --git a/lib/helper.php b/lib/helper.php index 497eb544..f04b7867 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -26,6 +26,10 @@ class Helper{ return $path; } + public static function isVersionsEnabled(){ + return \OCP\App::isEnabled('files_versions'); + } + public static function getRandomColor(){ $str = dechex(floor(rand(0, 16777215))); return '#' . str_pad($str, 6, "0", STR_PAD_LEFT);