mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
core: escape special characters in SQL search query (#7418)
Signed-off-by: Luis Kriner <luis@kriner.info>
This commit is contained in:
@@ -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("*") ||
|
||||||
|
|||||||
Reference in New Issue
Block a user