From 94b1110057025656a66fc268c3d01e4f199a5e16 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 25 May 2011 12:09:39 +0200 Subject: [PATCH] BZ6406 double space in search fails if you put 2 spaces between two words in any search, the result is that the search does not work anymore --- C4/Search.pm | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ab7cb59..f4c723f 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1127,7 +1127,11 @@ sub buildQuery { # COMBINE OPERANDS, INDEXES AND OPERATORS if ( $operands[$i] ) { - $operands[$i]=~s/^\s+//; + # remove starting blanks + $operands[$i] =~ s/^\s+//; + # remove multiple blanks that breaks the resulting query + $operands[$i] =~ s/\s+/ /g; + next unless $operands[$i]; # A flag to determine whether or not to add the index to the query my $indexes_set; -- 1.7.4.1