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 <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-08-31 17:29:36 +02:00
parent 6b9b88f8b7
commit a792a51dca
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 1 additions and 1 deletions

View File

@ -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];
}