From cc976f27e4cbd09a4b80de688fd34e19feb73343 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 9 Oct 2008 15:35:37 +0000 Subject: [PATCH] Move search query input cleansing to the server side Backport of 10805 from trunk, but we leave backslash cleansing on the client in rel_1_2 because backslashes reportedly cause problems with old-style JSON git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10806 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm | 2 +- Open-ILS/web/opac/skin/default/js/search_bar.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index d9cb12df27..d60b64dc3c 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -461,7 +461,7 @@ sub multiclass_query { my $orig_query = $query; $query =~ s/\+/ /go; - $query =~ s/'//go; + $query =~ s/'/ /go; $query =~ s/^\s+//go; # convert convenience classes (e.g. kw for keyword) to the full class name diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js index 5b6cccbb77..f9382e8404 100644 --- a/Open-ILS/web/opac/skin/default/js/search_bar.js +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -56,10 +56,8 @@ function searchBarSubmit(isFilterSort) { if(!text || text == "") return; - text = text.replace(/'/g,' '); + /* old JSON format breaks horribly if fed backslashes */ text = text.replace(/\\/g,' '); - text = text.replace(/^\s*/,''); - text = text.replace(/\s*$/,''); var d = (newSearchDepth != null) ? newSearchDepth : depthSelGetDepth(); if(isNaN(d)) d = 0; -- 2.11.0