core: escape special characters in SQL search query (#7418)

Signed-off-by: Luis Kriner <luis@kriner.info>
This commit is contained in:
luis-411
2025-02-11 07:00:51 +01:00
committed by GitHub
parent 7b13f35424
commit 43356e5b6a

View File

@@ -39,11 +39,7 @@ function escapeSQLString(str: string): string {
return `"${innerStr}"`; return `"${innerStr}"`;
} }
const maybeColspec = const maybeColspec = /[:<>./\\()$&=#!\-\+\~§@^?,;'"\[\]{}|]/.test(str);
str.includes(":") ||
str.includes(">") ||
str.includes("<") ||
str.includes("-");
const isWildcard = const isWildcard =
str.startsWith("*") || str.startsWith("*") ||
str.endsWith("*") || str.endsWith("*") ||