From: Robin Appelman Date: Mon, 31 Aug 2020 15:29:36 +0000 (+0200) Subject: dont use `false` as cache key for non utf8 path in normalizePath X-Git-Tag: v20.0.0beta4~23^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a792a51dca5fe55f3c05483e779958e4d56cdb9a;p=nextcloud-server.git dont use `false` as cache key for non utf8 path in normalizePath since `json_encode` returns `false` if it's input isn't utf8, all non utf8 paths passed to normalizePath will currently return the same cached result. Fixing this makes working with non utf8 storages a *little* bit more possible for apps Signed-off-by: Robin Appelman --- diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index b85554ae333..3ad518b3950 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -813,7 +813,7 @@ class Filesystem { $cacheKey = json_encode([$path, $stripTrailingSlash, $isAbsolutePath, $keepUnicode]); - if (isset(self::$normalizedPathCache[$cacheKey])) { + if ($cacheKey && isset(self::$normalizedPathCache[$cacheKey])) { return self::$normalizedPathCache[$cacheKey]; }