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