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