From 9f628498dadb857afc79fad053d21dfe0bb1c746 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Wed, 18 Apr 2012 10:41:27 -0400 Subject: [PATCH] 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 Signed-off-by: Dan Scott --- Open-ILS/web/js/dojo/openils/AutoSuggestStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ]; -- 2.43.2