mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 11:36:08 +08:00
fix(search): Add double quote escaping to search query
- Fixes sentry fts error
This commit is contained in:
parent
691edfcd5b
commit
54e588313e
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,9 @@ _ = require 'underscore'
|
||||||
# That's right. Two single quotes in a row…
|
# That's right. Two single quotes in a row…
|
||||||
singleQuoteEscapeSequence = "''"
|
singleQuoteEscapeSequence = "''"
|
||||||
|
|
||||||
|
# https://www.sqlite.org/fts5.html#section_3
|
||||||
|
doubleQuoteEscapeSequence = '""'
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
Public: The Matcher class encapsulates a particular comparison clause on an {Attribute}.
|
Public: The Matcher class encapsulates a particular comparison clause on an {Attribute}.
|
||||||
|
@ -219,6 +222,7 @@ class SearchMatcher extends Matcher
|
||||||
.replace(/^['"]/, "")
|
.replace(/^['"]/, "")
|
||||||
.replace(/['"]$/, "")
|
.replace(/['"]$/, "")
|
||||||
.replace(/'/g, singleQuoteEscapeSequence)
|
.replace(/'/g, singleQuoteEscapeSequence)
|
||||||
|
.replace(/"/g, doubleQuoteEscapeSequence)
|
||||||
)
|
)
|
||||||
@
|
@
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue