From d8668ddc4724bd3dbf52780f243014cb64330211 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Wed, 9 Sep 2009 14:25:44 +0200 Subject: [PATCH] [3.0.x](bug #3593) Fixes highlightning in search results I fixed a regexp and an encoding issue. --- C4/Search.pm | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 21eb767..f056900 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1180,7 +1180,7 @@ sub searchResults { # add search-term highlighting via s on the search terms my $span_terms_hashref; for my $span_term ( split( / /, $searchdesc ) ) { - $span_term =~ s/(.*=|\)|\(|\+|\.|\*)//g; + $span_term =~ s/(.*=|\)|\(|\+|\.|\*|\")//g; $span_terms_hashref->{$span_term}++; } @@ -1356,6 +1356,9 @@ sub searchResults { if ( length($term) > 3 ) { $term =~ s/(.*=|\)|\(|\+|\.|\?|\[|\]|\\|\*)//g; foreach(qw(title subtitle author publishercode place pages notes size)) { + if (! utf8::is_utf8($term)) { + utf8::decode($term); + } $oldbiblio->{$_} =~ s/$term/$&<\/span>/gi; } } -- 1.6.0.4