From e58b8a7877a907ae94c60f716cdaa7ec8ddaa419 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Tue, 8 Oct 2024 10:55:47 +0200 Subject: [PATCH] Fixes #1820: Normalise paths for checksum calls. --- src/Filesystem.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Filesystem.php b/src/Filesystem.php index a5ee34e26..4fb30cc10 100644 --- a/src/Filesystem.php +++ b/src/Filesystem.php @@ -187,7 +187,10 @@ public function publicUrl(string $path, array $config = []): string ?? throw UnableToGeneratePublicUrl::noGeneratorConfigured($path); $config = $this->config->extend($config); - return $this->publicUrlGenerator->publicUrl($this->pathNormalizer->normalizePath($path), $config); + return $this->publicUrlGenerator->publicUrl( + $this->pathNormalizer->normalizePath($path), + $config, + ); } public function temporaryUrl(string $path, DateTimeInterface $expiresAt, array $config = []): string @@ -214,9 +217,15 @@ public function checksum(string $path, array $config = []): string } try { - return $this->adapter->checksum($path, $config); + return $this->adapter->checksum( + $this->pathNormalizer->normalizePath($path), + $config, + ); } catch (ChecksumAlgoIsNotSupported) { - return $this->calculateChecksumFromStream($path, $config); + return $this->calculateChecksumFromStream( + $this->pathNormalizer->normalizePath($path), + $config, + ); } }