]> source.dussan.org Git - nextcloud-server.git/commitdiff
Catch more invalid cache source storage paths
authorJosh Richards <josh.t.richards@gmail.com>
Thu, 3 Aug 2023 13:53:46 +0000 (09:53 -0400)
committerGitHub <noreply@github.com>
Thu, 3 Aug 2023 13:53:46 +0000 (09:53 -0400)
OC\Files\Cache\Cache::get can return string|false|null, not just string|false.

- nextcloud/server#26270 added handling of false, but null is needed too.
- Well, or we change the default $resullt to false, but I'm not sure if that has other ramifications and the real need here is to simply catch situations where the cache source storage path is not valid for whatever reason

Related: nextcloud/server#19009

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
lib/private/Files/Cache/Cache.php

index 4770e168bfbec30520add3448c64532e8a7b058b..d3593cac8b9bffde943d8153dc591dbfd9dc91be 100644 (file)
@@ -668,7 +668,7 @@ class Cache implements ICache {
                        $targetPath = $this->normalize($targetPath);
 
                        $sourceData = $sourceCache->get($sourcePath);
-                       if ($sourceData === false) {
+                       if ($sourceData === false || $sourceData === null) {
                                throw new \Exception('Invalid source storage path: ' . $sourcePath);
                        }