From a115b36be963c07ed7bf694c74a6ab0c86b48e34 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Tue, 14 Nov 2023 15:53:00 +0100 Subject: [PATCH] IBX-6880: Skipped normalizing directories in the `normalizePath` method --- eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php b/eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php index fc96e6dbb1..dff3ed6062 100644 --- a/eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php +++ b/eZ/Publish/Core/IO/FilePathNormalizer/Flysystem.php @@ -35,8 +35,9 @@ 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 = Util::normalizePath($fileName); - return Util::normalizePath($filePath); + return $filePath . $normalizedFileName; } }