]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check for non-numeric versions, not non-integer 39117/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Wed, 5 Apr 2023 15:44:25 +0000 (17:44 +0200)
committerLouis <6653109+artonge@users.noreply.github.com>
Tue, 4 Jul 2023 13:11:41 +0000 (15:11 +0200)
All versions are string

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/files_versions/lib/Storage.php

index a22181acca1500dcee20ed88cb74665c329ccc27..676d94d2fb72a94cf4e54bad7c1580f68f7750db 100644 (file)
@@ -721,13 +721,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'];
                        }