Skip to content

Commit

Permalink
Check for non-numeric versions, not non-integer
Browse files Browse the repository at this point in the history
All versions are string

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Apr 5, 2023
1 parent 8cc8765 commit a6b1d99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,13 +716,13 @@ protected static function getExpireList($time, $versions, $quotaExceeded = false
}

foreach ($versions as $key => $version) {
if (!is_int($version['version'])) {
if (!is_numeric($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])) {
if ($expiration->isExpired((int)($version['version']), $quotaExceeded) && !isset($toDelete[$key])) {
$size += $version['size'];
$toDelete[$key] = $version['path'] . '.v' . $version['version'];
}
Expand Down

0 comments on commit a6b1d99

Please sign in to comment.