From: Jane Wagner <jwag...@ptfs.com>

Sending a search with a leading space triggers a jquery error; this
strips out leading (and trailing, just in case) spaces.

Updated to apply on master - ch...@bigballofwax.co.nz
---
 opac/opac-search.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/opac/opac-search.pl b/opac/opac-search.pl
index e1d61fa..62727f5 100755
--- a/opac/opac-search.pl
+++ b/opac/opac-search.pl
@@ -358,6 +358,8 @@ my @results;
 ## I. BUILD THE QUERY
 my $lang = C4::Output::getlanguagecookie($cgi);
 ( 
$error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type)
 = 
buildQuery(\...@operators,\...@operands,\...@indexes,\...@limits,\...@sort_by, 
0, $lang);
+$query_desc =~ s/^\s+//;        # removes leading space
+$query_desc =~ s/\s+$//;        # removes trailing space
 
 sub _input_cgi_parse ($) { 
     my @elements;
-- 
1.6.3.3

_______________________________________________
Koha-patches mailing list
Koha-patches@lists.koha.org
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to