Skip to content

Commit e186467

Browse files
Fix replacing .scss extension by .css (#23)
1 parent db73472 commit e186467

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AssetMapper/SassPublicPathAssetPathResolver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function resolvePublicPath(string $logicalPath): string
2121
{
2222
$path = $this->decorator->resolvePublicPath($logicalPath);
2323

24-
if (str_contains($path, '.scss')) {
25-
return str_replace('.scss', '.css', $path);
24+
if (str_ends_with($path, '.scss')) {
25+
return substr($path, 0, -5).'.css';
2626
}
2727

2828
return $path;
@@ -36,8 +36,8 @@ public function getPublicFilesystemPath(): string
3636

3737
$path = $this->decorator->getPublicFilesystemPath();
3838

39-
if (str_contains($path, '.scss')) {
40-
return str_replace('.scss', '.css', $path);
39+
if (str_ends_with($path, '.scss')) {
40+
return substr($path, 0, -5).'.css';
4141
}
4242

4343
return $path;

0 commit comments

Comments
 (0)