diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-09-17 17:29:34 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-09-17 20:00:31 +0200 |
commit | b04c7175dc89cb53b4719f140d65df01bdce1301 (patch) | |
tree | afaef4422823ce077e3f04c14c4ec20796c0f1be | |
parent | ce10e1c19a834d5bcec2a843904c13ee0ffcf4c3 (diff) | |
download | nextcloud-server-b04c7175dc89cb53b4719f140d65df01bdce1301.tar.gz nextcloud-server-b04c7175dc89cb53b4719f140d65df01bdce1301.zip |
Check if the versioned file exists before trying to do the versioning
This didn't work with chunked uploading
-rw-r--r-- | apps/files_versions/lib/versions.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index e429782aed1..c517eb01ff5 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -77,6 +77,7 @@ class Storage { $versionsFolderName=\OCP\Config::getSystemValue('datadirectory') . $this->view->getAbsolutePath(''); //check if source file already exist as version to avoid recursions. + // todo does this check work? if ($users_view->file_exists($filename)) { return false; } @@ -96,6 +97,11 @@ class Storage { } } + // we should have a source file to work with + if (!$files_view->file_exists($filename)) { + return false; + } + // check filesize if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) { return false; |