From 39069d50cffb0908ebd93cb4553ca5c0c5beecfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rokas=20Mikalk=C4=97nas?= Date: Tue, 14 Nov 2023 11:28:59 +0200 Subject: [PATCH] Normalize path when generating public or temporary url --- src/Filesystem.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Filesystem.php b/src/Filesystem.php index b3915b904..0ee74f269 100644 --- a/src/Filesystem.php +++ b/src/Filesystem.php @@ -187,7 +187,7 @@ public function publicUrl(string $path, array $config = []): string ?? throw UnableToGeneratePublicUrl::noGeneratorConfigured($path); $config = $this->config->extend($config); - return $this->publicUrlGenerator->publicUrl($path, $config); + return $this->publicUrlGenerator->publicUrl($this->pathNormalizer->normalizePath($path), $config); } public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string @@ -195,7 +195,11 @@ public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $ $generator = $this->temporaryUrlGenerator ?? $this->adapter; if ($generator instanceof TemporaryUrlGenerator) { - return $generator->temporaryUrl($path, $expiresAt, $this->config->extend($config)); + return $generator->temporaryUrl( + $this->pathNormalizer->normalizePath($path), + $expiresAt, + $this->config->extend($config) + ); } throw UnableToGenerateTemporaryUrl::noGeneratorConfigured($path);