Skip to content

Commit

Permalink
core: escape special characters in SQL search query (streetwriters#7418)
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Kriner <[email protected]>
  • Loading branch information
luis-411 authored Feb 11, 2025
1 parent 7b13f35 commit 43356e5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/core/src/utils/query-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("*") ||
Expand Down

0 comments on commit 43356e5

Please sign in to comment.