fix(search): Add double quote escaping to search query

- Fixes sentry fts error
This commit is contained in:
Juan Tejada 2016-05-11 12:32:54 -07:00
parent 7647fd396b
commit 4c49c143e8

View file

@ -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)
)
@