From 0c805dac7bc1a5d3b9d8cc35c85e8fbd559a1232 Mon Sep 17 00:00:00 2001 From: Maelan LE BORGNE Date: Thu, 26 Oct 2023 16:13:58 +0200 Subject: [PATCH] Fix replacing .scss extension by .css --- src/AssetMapper/SassPublicPathAssetPathResolver.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AssetMapper/SassPublicPathAssetPathResolver.php b/src/AssetMapper/SassPublicPathAssetPathResolver.php index 053b66d..8ce8b53 100644 --- a/src/AssetMapper/SassPublicPathAssetPathResolver.php +++ b/src/AssetMapper/SassPublicPathAssetPathResolver.php @@ -21,8 +21,8 @@ public function resolvePublicPath(string $logicalPath): string { $path = $this->decorator->resolvePublicPath($logicalPath); - if (str_contains($path, '.scss')) { - return str_replace('.scss', '.css', $path); + if (str_ends_with($path, '.scss')) { + return substr($path, 0, -5).'.css'; } return $path; @@ -32,8 +32,8 @@ public function getPublicFilesystemPath(): string { $path = $this->decorator->getPublicFilesystemPath(); - if (str_contains($path, '.scss')) { - return str_replace('.scss', '.css', $path); + if (str_ends_with($path, '.scss')) { + return substr($path, 0, -5).'.css'; } return $path;