From: Björn Schießle Date: Wed, 8 May 2013 14:32:29 +0000 (+0200) Subject: rename a file if it gets restored so that it no longer exists as a version. Otherwise... X-Git-Tag: v5.0.6~7^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=35da6f25b166c05d899ee493f6fdd1c35088302b;p=nextcloud-server.git rename a file if it gets restored so that it no longer exists as a version. Otherwise it can happen that the expire() function removes all other versions so that we end up with only one version which is exactly the same as the original file --- diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 836e3914dc0..5fdbef27743 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -200,7 +200,7 @@ class Storage { } // rollback - if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { + if( @$users_view->rename('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { $files_view->touch($file, $revision); Storage::expire($file); return true;