From 1c5ee75c34724d916b1a2d4ad39da1cf98b23e00 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Sat, 4 Jan 2025 23:02:53 -0500 Subject: [PATCH] codeql --- src/utils.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index 354b35c..1a164e7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -205,14 +205,20 @@ function getFontPbf(allowedFonts, fontPath, name, range, fallbacks) { name.trim() === '' || !fontMatch ) { - console.error('ERROR: Invalid font name: %s', sanitizedName); + console.error( + 'ERROR: Invalid font name: %s', + sanitizedName.replace(/\n|\r/g, ''), + ); return reject('Invalid font name'); } const rangeMatch = range?.match(/^[\d-]+$/); const sanitizedRange = rangeMatch?.[0] || 'invalid'; if (!/^\d+-\d+$/.test(range)) { - console.error('ERROR: Invalid range: %s', sanitizedRange); + console.error( + 'ERROR: Invalid range: %s', + sanitizedRange.replace(/\n|\r/g, ''), + ); return reject('Invalid range'); } const filename = path.join(