Check for non-numeric versions, not non-integer

All versions are string

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-04-05 17:44:25 +02:00 committed by Louis
parent 58a950b8a0
commit f3f2b0f0a8

View file

@ -721,13 +721,13 @@ class Storage {
}
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'];
}