From 898b78535b5f4f38cff2d4814f07136245468725 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Fri, 18 Dec 2009 13:52:56 -0500 Subject: [PATCH] Bug 3955: Fixes leading space error in search. Leading spaces in a search term were causing an error to be thrown in a join operator when auto-truncations is turned on. This patch removes the leading spaces. --- C4/Search.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 2fe57ed958..e8903fcd2c 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -932,8 +932,10 @@ sub buildQuery { } if ($auto_truncation){ - $operand=~join(" ",map{ "$_*" }split (/\s+/,$operand)); - } + # join throws an error if there is a leading space + $operand =~ s/^\s+//; + $operand=~join(" ",map{ "$_*" }split (/\s+/,$operand)); + } # Detect Truncation my $truncated_operand; -- 2.39.5