Merge pull request #39117 from nextcloud/backport/37428/stable26

[stable26] Ignore and log non integer versions
This commit is contained in:
Louis 2023-07-05 15:41:03 +02:00 committed by GitHub
commit 981262c57b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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