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
Prev Previous commit
Check for non-numeric versions, not non-integer
All versions are string

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc authored and artonge committed Jul 4, 2023
commit f3f2b0f0a8d0af164440607b5cd9c079cead471d
4 changes: 2 additions & 2 deletions apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -721,13 +721,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