From 8e27aea28dbf794fbfbf89550a242b4042bdcb51 Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 25 Apr 2013 21:39:02 +0200 Subject: [PATCH] minor gui fix to support apostroph in the query --- webui/model/search/search.php | 1 + webui/view/javascript/piler-in.js | 5 ++++- webui/view/theme/default/templates/search/load.tpl | 2 +- webui/view/theme/orig/templates/search/load.tpl | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 1e3937d3..ed41c528 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -794,6 +794,7 @@ class ModelSearchSearch extends Model { if($s == '') { return $s; } $s = preg_replace("/\'/", ' ', $s); + $s = preg_replace("/\./", ' ', $s); return $s; } diff --git a/webui/view/javascript/piler-in.js b/webui/view/javascript/piler-in.js index 9241487b..43ccea67 100644 --- a/webui/view/javascript/piler-in.js +++ b/webui/view/javascript/piler-in.js @@ -448,11 +448,14 @@ var Piler = { Piler.log("[load_search_results_for_saved_query]", terms); + terms = decodeURIComponent(terms); + var pairs = terms.split('&'); $.each(pairs, function(i, v){ var pair = v.split('='); if(pair[0] == 'search') { - $("input#_search").val(pair[1]); + var search = decodeURIComponent(pair[1]); + $("input#_search").val(search.replace(/\+/g, " ")); } }); diff --git a/webui/view/theme/default/templates/search/load.tpl b/webui/view/theme/default/templates/search/load.tpl index dec4a284..1993404b 100644 --- a/webui/view/theme/default/templates/search/load.tpl +++ b/webui/view/theme/default/templates/search/load.tpl @@ -10,7 +10,7 @@ if(isset($s['search'])) { ?> - +   diff --git a/webui/view/theme/orig/templates/search/load.tpl b/webui/view/theme/orig/templates/search/load.tpl index d55b9bbf..2db14ead 100644 --- a/webui/view/theme/orig/templates/search/load.tpl +++ b/webui/view/theme/orig/templates/search/load.tpl @@ -18,7 +18,7 @@ if(isset($s['search']) && $s['search']) { ?>
-
+