Skip to content

Commit 54dab46

Browse files
fix(customizer): address font catalogue review feedback
Agent-Logs-Url: https://github.com/helsingborg-stad/Municipio/sessions/a7976a2b-1549-4ac8-9373-c80188045b78 Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>
1 parent 9fc5393 commit 54dab46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/Customizer/Fonts/UploadedFontMapper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ public function fromUploadValue(int|string $file, string $fontName): ?array
6969
return null;
7070
}
7171

72+
$extension = pathinfo(basename($file), PATHINFO_EXTENSION);
73+
7274
return [
7375
'id' => 0,
7476
'name' => $fontName,
75-
'type' => pathinfo(basename($file), PATHINFO_EXTENSION) !== '' ? pathinfo(basename($file), PATHINFO_EXTENSION) : 'woff',
77+
'type' => $extension !== '' ? $extension : 'woff',
7678
'url' => $file,
7779
];
7880
}

0 commit comments

Comments
 (0)