[open-ils-commits] r10806 - in branches/rel_1_2/Open-ILS: src/perlmods/OpenILS/Application/Search web/opac/skin/default/js

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Oct 9 11:35:39 EDT 2008


Author: dbs
Date: 2008-10-09 11:35:37 -0400 (Thu, 09 Oct 2008)
New Revision: 10806

Modified:
   branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
   branches/rel_1_2/Open-ILS/web/opac/skin/default/js/search_bar.js
Log:
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


Modified: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2008-10-09 15:34:00 UTC (rev 10805)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm	2008-10-09 15:35:37 UTC (rev 10806)
@@ -461,7 +461,7 @@
     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

Modified: branches/rel_1_2/Open-ILS/web/opac/skin/default/js/search_bar.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/skin/default/js/search_bar.js	2008-10-09 15:34:00 UTC (rev 10805)
+++ branches/rel_1_2/Open-ILS/web/opac/skin/default/js/search_bar.js	2008-10-09 15:35:37 UTC (rev 10806)
@@ -56,10 +56,8 @@
 
 	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;



More information about the open-ils-commits mailing list