From ac5a1bfececb5400a77f0ebad90181f5215d5a85 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Mar 2016 09:41:58 +0100 Subject: [PATCH] Bug 16154: CGI->multi_param - Manual changes This patch does the same as the previous one, but affects lines which have not been caught by the regex. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- C4/Biblio.pm | 2 +- catalogue/itemsearch.pl | 4 ++-- catalogue/search.pl | 10 +++++----- opac/ilsdi.pl | 2 +- opac/opac-image.pl | 2 +- serials/serials-search.pl | 2 +- svc/import_bib | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 0db6f1f7b0..a59b1b779a 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2516,7 +2516,7 @@ sub _default_ind_to_space { sub TransformHtmlToMarc { my ($cgi, $isbiblio) = @_; - my @params = $cgi->param(); + my @params = $cgi->multi_param(); # explicitly turn on the UTF-8 flag for all # 'tag_' parameters to avoid incorrect character diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index ff614e2167..dade645ae6 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -43,7 +43,7 @@ if (defined $format and $format eq 'json') { # Map DataTables parameters with 'regular' parameters $cgi->param('rows', $cgi->param('iDisplayLength')); $cgi->param('page', ($cgi->param('iDisplayStart') / $cgi->param('iDisplayLength')) + 1); - my @columns = split /,/, $cgi->param('sColumns'); + my @columns = split /,/, $cgi->multi_param('sColumns'); $cgi->param('sortby', $columns[ $cgi->param('iSortCol_0') ]); $cgi->param('sortorder', $cgi->param('sSortDir_0')); @@ -102,7 +102,7 @@ if (scalar keys %params > 0) { }; foreach my $p (qw(homebranch location itype ccode issues datelastborrowed notforloan)) { - if (my @q = $cgi->param($p)) { + if (my @q = $cgi->multi_param($p)) { if ($q[0] ne '') { my $f = { field => $p, diff --git a/catalogue/search.pl b/catalogue/search.pl index 3935851545..8dd8c4a2cb 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -381,11 +381,11 @@ unless (@servers) { } # operators include boolean and proximity operators and are used # to evaluate multiple operands -my @operators = map uri_unescape($_), $cgi->param('op'); +my @operators = map uri_unescape($_), $cgi->multi_param('op'); # indexes are query qualifiers, like 'title', 'author', etc. They # can be single or multiple parameters separated by comma: kw,right-Truncation -my @indexes = map uri_unescape($_), $cgi->param('idx'); +my @indexes = map uri_unescape($_), $cgi->multi_param('idx'); # if a simple index (only one) display the index used in the top search box if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) { @@ -395,11 +395,11 @@ 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 uri_unescape($_), $cgi->multi_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'); -my @nolimits = map uri_unescape($_), $cgi->param('nolimit'); +my @limits = map uri_unescape($_), $cgi->multi_param('limit'); +my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit'); my %is_nolimit = map { $_ => 1 } @nolimits; @limits = grep { not $is_nolimit{$_} } @limits; diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl index 6a91069670..108acc38d9 100755 --- a/opac/ilsdi.pl +++ b/opac/ilsdi.pl @@ -171,7 +171,7 @@ if ( $service and any { $service eq $_ } @services ) { my @parmsrequired = @{ $required{$service} }; my @parmsoptional = @{ $optional{$service} }; my @parmsall = ( @parmsrequired, @parmsoptional ); - my @names = $cgi->param; + my @names = $cgi->multi_param; my %paramhash; $paramhash{$_} = 1 for @names; diff --git a/opac/opac-image.pl b/opac/opac-image.pl index 8e627b1b5f..0318aa09f7 100755 --- a/opac/opac-image.pl +++ b/opac/opac-image.pl @@ -64,7 +64,7 @@ if ( C4::Context->preference("OPACLocalCoverImages") ) { $imagenumber = $data->param('imagenumber'); } elsif ( defined $data->param('biblionumber') ) { - my @imagenumbers = ListImagesForBiblio( $data->param('biblionumber') ); + my @imagenumbers = ListImagesForBiblio( scalar $data->param('biblionumber') ); if (@imagenumbers) { $imagenumber = $imagenumbers[0]; } diff --git a/serials/serials-search.pl b/serials/serials-search.pl index e5eb0dcd8a..afa24b1ffc 100755 --- a/serials/serials-search.pl +++ b/serials/serials-search.pl @@ -53,7 +53,7 @@ my $location = $query->param('location_filter') || ''; my $expiration_date = $query->param('expiration_date_filter') || ''; my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); my $searched = $query->param('searched') || 0; -my @subscriptionids = $query ->param('subscriptionid'); +my @subscriptionids = $query->multi_param('subscriptionid'); my $op = $query->param('op'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( diff --git a/svc/import_bib b/svc/import_bib index b02e5f2671..a23b72de65 100755 --- a/svc/import_bib +++ b/svc/import_bib @@ -44,7 +44,7 @@ if ($query->request_method eq "POST") { $xml = $query->param('xml'); } if ($xml) { - my %params = map { $_ => $query->param($_) } $query->param; + my %params = map { $_ => scalar $query->param($_) } $query->param; my $result = import_bib($xml, \%params ); print $query->header(-type => 'text/xml'); print XMLout($result, NoAttr => 1, RootName => 'response', XMLDecl => 1); -- 2.39.5