From 8d8227a0943d38c35a61d1dfe8c2ac0a6d43c463 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Thu, 7 Apr 2016 09:43:07 -0700 Subject: [PATCH] fix(search): Escape search query properly --- src/flux/attributes/matcher.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/flux/attributes/matcher.coffee b/src/flux/attributes/matcher.coffee index f896abbcf..3de2f624c 100644 --- a/src/flux/attributes/matcher.coffee +++ b/src/flux/attributes/matcher.coffee @@ -208,8 +208,13 @@ class NotCompositeMatcher extends Matcher return "NOT (" + wheres.join(" AND ") + ")" class SearchMatcher extends Matcher - constructor: (@searchQuery) -> + constructor: (searchQuery) -> super(null, null, null) + @searchQuery = ( + searchQuery.trim() + .replace(/^['"]/, "") + .replace(/['"]$/, "") + ) @ attribute: =>