From 4abba9267ddaf8f60f85698bae8310c4cabe1b16 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Fri, 22 Dec 2023 13:44:19 +0100 Subject: [PATCH] IBX-6880: Skipped normalizing directories in the `normalizePath` method For more details see https://issues.ibexa.co/browse/IBX-6880 and https://github.com/ezsystems/ezplatform-kernel/pull/393 --- 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; } }