Skip to content

Commit a6b1d99

Browse files
committed
Check for non-numeric versions, not non-integer
All versions are string Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 8cc8765 commit a6b1d99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/files_versions/lib/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,13 +716,13 @@ protected static function getExpireList($time, $versions, $quotaExceeded = false
716716
}
717717

718718
foreach ($versions as $key => $version) {
719-
if (!is_int($version['version'])) {
719+
if (!is_numeric($version['version'])) {
720720
\OC::$server->get(LoggerInterface::class)->error(
721721
'Found a non-numeric timestamp version: '. json_encode($version),
722722
['app' => 'files_versions']);
723723
continue;
724724
}
725-
if ($expiration->isExpired($version['version'], $quotaExceeded) && !isset($toDelete[$key])) {
725+
if ($expiration->isExpired((int)($version['version']), $quotaExceeded) && !isset($toDelete[$key])) {
726726
$size += $version['size'];
727727
$toDelete[$key] = $version['path'] . '.v' . $version['version'];
728728
}

0 commit comments

Comments
 (0)