From: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com> Date: Wed, 18 Apr 2012 14:41:27 +0000 (-0400) Subject: AutoSuggest: Escape ampersands properly X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9f628498dadb857afc79fad053d21dfe0bb1c746;p=evergreen%2Fmasslnc.git AutoSuggest: Escape ampersands properly This fixes an issue reported by Yamil Suarez. If you had relatively technical users composing searches with QueryParser syntax, or if they were just typing ampersands for any other reason, AutoSuggest would behave as if the ampersand marked the end of user input. This is fixed by applying the correct URI-encoding function for the situation. To be clear, QueryParser syntax does not actually affect suggestions; such syntax is ignored. AutoSuggest is not search. Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com> Signed-off-by: Dan Scott <dan@coffeecode.net> --- diff --git a/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js b/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js index b36b6a492d..d598159f0c 100644 --- a/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js +++ b/Open-ILS/web/js/dojo/openils/AutoSuggestStore.js @@ -132,7 +132,7 @@ if (!dojo._hasResource["openils.AutoSuggestStore"]) { term = term.replace(/\*$/, ""); var params = [ - "query=" + encodeURI(term), + "query=" + encodeURIComponent(term), "search_class=" + this.type_selector.value, "limit=" + limit ];