From f1ae358bcdd734e849d6c77cf7265b3d32039c7b Mon Sep 17 00:00:00 2001 From: acli Date: Tue, 4 Feb 2003 04:44:35 +0000 Subject: [PATCH] Reverted to using s/// instead of quotemeta for title/author/illustrator, to avoid quoting spaces (which results in most titles/authors etc. becoming unsearchable) (Bug 197) --- C4/Search.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index ad8c18dd73..eb4cb961a8 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -858,9 +858,16 @@ sub CatSearch { my $dbh = C4::Context->dbh; my $query = ''; my @results; + + # Why not just use quotemeta to escape all questionable characters, + # not just single-quotes? Because that would also escape spaces, + # which would cause titles/authors/illustrators with a space to + # become unsearchable (Bug 197) + for my $field ('title', 'author', 'illustrator') { - $search->{$field} = quotemeta($search->{$field}); + $search->{$field} =~ s/['"]/\\\1/g; } + my $title = lc($search->{'title'}); if ($type eq 'loose') { if ($search->{'author'} ne ''){ -- 2.39.5