fix regex error
This commit is contained in:
parent
930e5719c7
commit
03b1c31083
1 changed files with 1 additions and 1 deletions
|
@ -260,7 +260,7 @@ export function readFile(filename) {
|
||||||
*/
|
*/
|
||||||
async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) {
|
async function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) {
|
||||||
if (!allowedFonts || (allowedFonts[name] && fallbacks)) {
|
if (!allowedFonts || (allowedFonts[name] && fallbacks)) {
|
||||||
const fontMatch = name?.match(/^[\p{L}\p{N} \-\.~!*\'()@&=+,#$\[\]]+$/u);
|
const fontMatch = name?.match(/^[\p{L}\p{N} \-\.~!*'()@&=+,#$\[\]]+$/u);
|
||||||
const sanitizedName = fontMatch?.[0] || 'invalid';
|
const sanitizedName = fontMatch?.[0] || 'invalid';
|
||||||
if (!name || typeof name !== 'string' || name.trim() === '' || !fontMatch) {
|
if (!name || typeof name !== 'string' || name.trim() === '' || !fontMatch) {
|
||||||
console.error(
|
console.error(
|
||||||
|
|
Loading…
Reference in a new issue