From 013ae858cde9a1b6e2d89b026274c4236ebd76fa Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 8 Dec 2004 10:21:46 +0000 Subject: [PATCH] * fixing "start by" operator * in biblio search, - and other signs where not properly managed. Leroy-Beaulieu could not be found --- C4/SearchMarc.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index 4bfaf8089a..12e9a39458 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -201,6 +201,7 @@ sub catalogsearch { @$value[$i] =~ s/\*/%/g; # remove % at the beginning @$value[$i] =~ s/^%//g; + @$value[$i] =~ s/(\.|\?|\:|\!|\'|,|\-|\"|\(|\)|\[|\]|\{|\})/ /g; if(@$excluding[$i]) # NOT statements { $any_not = 1; @@ -405,7 +406,7 @@ sub create_request { if ($nb_active==1) { if (@$operator[$i] eq "start") { $sql_tables .= "marc_subfield_table as m$nb_table,"; - $sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]"); + $sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]%"); if (@$tags[$i]) { $sql_where1 .=" and concat(m1.tag,m1.subfieldcode) in (@$tags[$i])"; } @@ -429,7 +430,7 @@ sub create_request { if (@$operator[$i] eq "start") { $nb_table++; $sql_tables .= "marc_subfield_table as m$nb_table,"; - $sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]"); + $sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]%"); if (@$tags[$i]) { $sql_where1 .=" and concat(m$nb_table.tag,m$nb_table.subfieldcode) in (@$tags[$i])"; } -- 2.39.5