Check for non-numeric versions, not non-integer

All versions are string

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/37428/head
Côme Chilliet 3 years ago
parent 8cc8765089
commit a6b1d990a4
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 4
      apps/files_versions/lib/Storage.php

@ -716,13 +716,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'];
}

Loading…
Cancel
Save