Skip to content

Commit e34e120

Browse files
innocenzibrendt
andauthored
fix(view): handle icon name parsing without colon (#1298)
Co-authored-by: Brent Roose <[email protected]>
1 parent 57792d1 commit e34e120

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/view/src/Components/Icon.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ private function download(string $prefix, string $name): ?string
7575
private function svg(string $name): ?string
7676
{
7777
try {
78-
$parts = explode(':', Str\replace($name, '-', ':'), 2);
78+
if (! Str\contains($name, ':')) {
79+
$name = Str\replace_first($name, '-', ':');
80+
}
81+
82+
$parts = explode(':', $name, limit: 2);
7983

8084
if (count($parts) !== 2) {
8185
return null;

0 commit comments

Comments
 (0)