aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-04-20 13:33:58 +0200
committerGitHub <noreply@github.com>2023-04-20 13:33:58 +0200
commit60b7d2117ed0963a341aa6ebac103d1bc77aebf0 (patch)
tree49fb163eb8104c5e4474669979354601d839fc1d /apps/files_versions
parentc909e926b232623694f1d3a77cf214fe30f8b97e (diff)
parenta6b1d990a420beb229b7c9935eb86f5b3eacc383 (diff)
downloadnextcloud-server-60b7d2117ed0963a341aa6ebac103d1bc77aebf0.tar.gz
nextcloud-server-60b7d2117ed0963a341aa6ebac103d1bc77aebf0.zip
Merge pull request #37428 from nextcloud/enh/ignore-non-numeric-versions
Ignore and log non integer versions
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/Storage.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 8fddf589a44..85d8660f240 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -710,7 +710,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'];
}