diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-01-21 20:49:56 +0400 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-01-21 20:49:56 +0400 |
commit | 603828366f1ea990fc359cc9f5f08007ed41ffbb (patch) | |
tree | 7309d7687ebd66c24783928d9d69b3dce2d9cfeb /apps/files_versions | |
parent | 180bb9fa9f65061d1cc074ec1b749651d3c567b5 (diff) |
selective backport of the bug fixes from pr #6863
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/versions.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 01c2e1ccdee..c2435b9cd65 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -543,15 +543,16 @@ class Storage { foreach ($versions as $key => $version) { $newInterval = true; while ($newInterval) { - if ($nextInterval == -1 || $version['version'] >= $nextInterval) { + if ($nextInterval == -1 || $prevTimestamp > $nextInterval) { if ($version['version'] > $nextVersion) { //distance between two version too small, delete version - $versionsFileview->unlink($version['path'] . '.v' . $version['version']); \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'] . '.v' . $version['version'])); + $versionsFileview->unlink($version['path'] . '.v' . $version['version']); $size += $version['size']; unset($allVersions[$key]); // update array with all versions } else { $nextVersion = $version['version'] - $step; + $prevTimestamp = $version['version']; } $newInterval = false; // version checked so we can move to the next one } else { // time to move on to the next interval @@ -566,7 +567,6 @@ class Storage { $newInterval = true; // we changed the interval -> check same version with new interval } } - $prevTimestamp = $version['version']; } } return $size; |