From 563199682023fa054e66a286f1426f0391cbbb89 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Mar 2016 09:41:58 +0100 Subject: [PATCH] [PASSED QA] 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: Katrin Fischer --- 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 9a7c86d..dd5d62b 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2513,7 +2513,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 ff614e2..dade645 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 d30eede..1c9a4fd 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -400,11 +400,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'})) { @@ -414,11 +414,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 6a91069..108acc3 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 8e627b1..0318aa0 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 e5eb0dc..afa24b1 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 b02e5f2..a23b72d 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); -- 1.9.1