From a792a51dca5fe55f3c05483e779958e4d56cdb9a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 31 Aug 2020 17:29:36 +0200 Subject: [PATCH] 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 --- lib/private/Files/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index b85554ae333a3..3ad518b3950b6 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -813,7 +813,7 @@ public static function normalizePath($path, $stripTrailingSlash = true, $isAbsol $cacheKey = json_encode([$path, $stripTrailingSlash, $isAbsolutePath, $keepUnicode]); - if (isset(self::$normalizedPathCache[$cacheKey])) { + if ($cacheKey && isset(self::$normalizedPathCache[$cacheKey])) { return self::$normalizedPathCache[$cacheKey]; }