Skip to content

Commit c1ced1d

Browse files
committed
💄
1 parent dd558a9 commit c1ced1d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/package.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,10 @@ function sanitizeCommitMessage(message?: string): string | undefined {
422422
return undefined;
423423
}
424424

425+
// Remove any unsafe characters found by the unsafeRegex
425426
// Check for characters that might escape quotes or introduce shell commands.
426427
// Don't allow: ', ", `, $, \ (except for \n which is allowed)
427-
const unsafeRegex = /(?<!\\)\\(?!n)|['"`$]/g;
428-
429-
// Remove any unsafe characters found by the unsafeRegex
430-
const sanitizedMessage = message.replace(unsafeRegex, '');
428+
const sanitizedMessage = message.replace(/(?<!\\)\\(?!n)|['"`$]/g, '');
431429

432430
if (sanitizedMessage.length === 0) {
433431
return undefined;

0 commit comments

Comments
 (0)