Better validation

This commit is contained in:
syuilo 2020-02-20 13:33:41 +09:00 committed by GitHub
parent 330ea7d210
commit 2504b8391b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,3 @@
export function safeForSql(text: string): boolean { export function safeForSql(text: string): boolean {
return /[\0\x08\x09\x1a\n\r"'\\\%]/g.test(text); return !/[\0\x08\x09\x1a\n\r"'\\\%]/g.test(text);
} }