diff --git a/src/lib/IO/FilePathNormalizer/Flysystem.php b/src/lib/IO/FilePathNormalizer/Flysystem.php index 14f92f1c3e..94472cd60f 100644 --- a/src/lib/IO/FilePathNormalizer/Flysystem.php +++ b/src/lib/IO/FilePathNormalizer/Flysystem.php @@ -37,9 +37,10 @@ public function normalizePath(string $filePath, bool $doHash = true): string ? (preg_match(self::HASH_PATTERN, $fileName) ? '' : bin2hex(random_bytes(6)) . '-') : ''; - $filePath = $directory . \DIRECTORY_SEPARATOR . $hash . $fileName; + $filePath = $directory . \DIRECTORY_SEPARATOR . $hash; + $normalizedFileName = $this->pathNormalizer->normalizePath($fileName); - return $this->pathNormalizer->normalizePath($filePath); + return $filePath . $normalizedFileName; } }