Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ignore and log non integer versions
This avoids being stuck when there is one buggy file version with a
 non-integer version. It allows the expiration process to not crash and
 continue with the other ones.

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Apr 5, 2023
commit 8cc8765089274ef8a80bc398ed7cc38b0df214f9
6 changes: 6 additions & 0 deletions apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,12 @@ protected static function getExpireList($time, $versions, $quotaExceeded = false
}

foreach ($versions as $key => $version) {
if (!is_int($version['version'])) {
\OC::$server->get(LoggerInterface::class)->error(
'Found a non-numeric timestamp version: '. json_encode($version),
['app' => 'files_versions']);
continue;
}
if ($expiration->isExpired($version['version'], $quotaExceeded) && !isset($toDelete[$key])) {
$size += $version['size'];
$toDelete[$key] = $version['path'] . '.v' . $version['version'];
Expand Down