From 930e5719c78c8adb18026729584968be5b2296c7 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Fri, 10 Jan 2025 15:15:05 -0500 Subject: [PATCH] make font regex less restrictive --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 099acdf..aa1e691 100644 --- a/src/utils.js +++ b/src/utils.js @@ -260,7 +260,7 @@ export function readFile(filename) { */ async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) { if (!allowedFonts || (allowedFonts[name] && fallbacks)) { - const fontMatch = name?.match(/^[\w\s-]+$/); + const fontMatch = name?.match(/^[\p{L}\p{N} \-\.~!*\'()@&=+,#$\[\]]+$/u); const sanitizedName = fontMatch?.[0] || 'invalid'; if (!name || typeof name !== 'string' || name.trim() === '' || !fontMatch) { console.error(