From d6fe5acbecbafd9880e00afb4c80d0fd96e18793 Mon Sep 17 00:00:00 2001 From: Josh Richards Date: Thu, 3 Aug 2023 09:53:46 -0400 Subject: [PATCH] Catch more invalid cache source storage paths 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 --- lib/private/Files/Cache/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 8fe413a0206..1d22a3835e9 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -681,7 +681,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); }