Skip to content
Snippets Groups Projects
Commit 3f9cab00 authored by Björn Schießle's avatar Björn Schießle
Browse files

Merge pull request #11507 from owncloud/versioning_expire

make sure that we always delete oldest first
parents 87899db2 8e077cf1
No related branches found
No related tags found
No related merge requests found
......@@ -517,6 +517,9 @@ class Storage {
// but always keep the two latest versions
$numOfVersions = count($allVersions) -2 ;
$i = 0;
// sort oldest first and make sure that we start at the first element
ksort($allVersions);
reset($allVersions);
while ($availableSpace < 0 && $i < $numOfVersions) {
$version = current($allVersions);
\OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version']));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment