mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +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}"`;
|
||||
}
|
||||
|
||||
const maybeColspec =
|
||||
str.includes(":") ||
|
||||
str.includes(">") ||
|
||||
str.includes("<") ||
|
||||
str.includes("-");
|
||||
const maybeColspec = /[:<>./\\()$&=#!\-\+\~§@^?,;'"\[\]{}|]/.test(str);
|
||||
const isWildcard =
|
||||
str.startsWith("*") ||
|
||||
str.endsWith("*") ||
|
||||
|
||||
Reference in New Issue
Block a user