Skip to content

Commit 476db83

Browse files
committed
fix: use explicit character set in validation regex
Replace \w with [a-zA-Z0-9\-_] to avoid matching unintended characters and improve validation accuracy.
1 parent 96444fb commit 476db83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/server/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function validateDotfilesRepo(url: string | null | undefined): Validation
6060
return { valid: false, error: 'Invalid dotfiles repo URL path' };
6161
}
6262

63-
if (!/^\/[\w\-\.\/]+(?:\.git)?$/.test(parsed.pathname)) {
63+
if (!/^\/[a-zA-Z0-9\-_\.\/]+(?:\.git)?$/.test(parsed.pathname)) {
6464
return { valid: false, error: 'Invalid dotfiles repo URL format' };
6565
}
6666

0 commit comments

Comments
 (0)