diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-03-27 17:37:16 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-04-05 17:44:14 +0200 |
commit | 8cc8765089274ef8a80bc398ed7cc38b0df214f9 (patch) | |
tree | 64baeb90e9a716846167cfd02febc0c239df8dc1 /apps | |
parent | 2dc96b31489276e1ce1ccc161449fa0d68d89336 (diff) | |
download | nextcloud-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.php | 6 |
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']; |