From 6665e2441e17cf8827c0117f4bdde9ed4813a941 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 23 Jul 2014 17:03:51 +0200 Subject: [PATCH] Bug 11944: decode uri_unescape data This data is passed into form so it needs to be correctly marked as utf-8 if we want form submit to work correctly This change fixes sort issues which use form submit. --- catalogue/search.pl | 4 ++-- opac/opac-search.pl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index e313109..5238254 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -412,7 +412,7 @@ if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) { } # an operand can be a single term, a phrase, or a complete ccl query -my @operands = map uri_unescape($_), $cgi->param('q'); +my @operands = map Encode::decode_utf8( uri_unescape($_) ), $cgi->param('q'); # limits are use to limit to results to a pre-defined category such as branch or language my @limits = map uri_unescape($_), $cgi->param('limit'); @@ -496,7 +496,7 @@ for my $this_cgi ( split('&',$query_cgi) ) { $this_cgi =~ m/(.*?)=(.*)/; my $input_name = $1; my $input_value = $2; - push @query_inputs, { input_name => $input_name, input_value => $input_value }; + push @query_inputs, { input_name => $input_name, input_value => Encode::decode_utf8( uri_unescape( $input_value ) ) }; if ($input_name eq 'idx') { $scan_index_to_use = $input_value; # unless $scan_index_to_use; } diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 6e0a8fe..6cc08b4 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -456,7 +456,7 @@ sub _input_cgi_parse { for my $this_cgi ( split('&',shift) ) { next unless $this_cgi; $this_cgi =~ /(.*?)=(.*)/; - push @elements, { input_name => $1, input_value => uri_unescape($2) }; + push @elements, { input_name => $1, input_value => Encode::decode_utf8( uri_unescape($2) ) }; } return @elements; } -- 1.7.2.5