From 00dec8c5a02f7a81c378dd96b3236b066d48417e Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Mon, 20 Apr 2026 12:08:41 +0200 Subject: [PATCH] fix: correct regex escape for hyphen in FCM token validation --- lib/push/validation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/push/validation.ts b/lib/push/validation.ts index ac5a8b4a..10fad1e7 100644 --- a/lib/push/validation.ts +++ b/lib/push/validation.ts @@ -6,5 +6,5 @@ export function isValidFcmToken(value: unknown): value is string { // FCM registration tokens are opaque. In practice they're ~140–250 chars of // [A-Za-z0-9:_-]. Be permissive on length; strict on charset to block // obvious garbage without rejecting future token formats. - return typeof value === 'string' && value.length >= 64 && value.length <= 4096 && /^[A-Za-z0-9:_\-]+$/.test(value); + return typeof value === 'string' && value.length >= 64 && value.length <= 4096 && /^[A-Za-z0-9:_-]+$/.test(value); }