summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-03-27 17:37:16 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-04-05 17:44:14 +0200
commit8cc8765089274ef8a80bc398ed7cc38b0df214f9 (patch)
tree64baeb90e9a716846167cfd02febc0c239df8dc1 /apps
parent2dc96b31489276e1ce1ccc161449fa0d68d89336 (diff)
downloadnextcloud-server-8cc8765089274ef8a80bc398ed7cc38b0df214f9.tar.gz
nextcloud-server-8cc8765089274ef8a80bc398ed7cc38b0df214f9.zip
Ignore and log non integer versions
This avoids being stuck when there is one buggy file version with a non-integer version. It allows the expiration process to not crash and continue with the other ones. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_versions/lib/Storage.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 75ca7e4bcee..fd2417dc6d7 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -716,6 +716,12 @@ class Storage {
}
foreach ($versions as $key => $version) {
+ if (!is_int($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])) {
$size += $version['size'];
$toDelete[$key] = $version['path'] . '.v' . $version['version'];