Bug 16154: CGI->multi_param - Manual changes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Mar 2016 08:41:58 +0000 (09:41 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 26 Apr 2016 23:16:43 +0000 (23:16 +0000)
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 <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

C4/Biblio.pm
catalogue/itemsearch.pl
catalogue/search.pl
opac/ilsdi.pl
opac/opac-image.pl
serials/serials-search.pl
svc/import_bib

index 0db6f1f..a59b1b7 100644 (file)
@@ -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
index ff614e2..dade645 100755 (executable)
@@ -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,
index 3935851..8dd8c4a 100755 (executable)
@@ -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;
 
index 6a91069..108acc3 100755 (executable)
@@ -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;
 
index 8e627b1..0318aa0 100755 (executable)
@@ -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];
         }
index e5eb0dc..afa24b1 100755 (executable)
@@ -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(
index b02e5f2..a23b72d 100755 (executable)
@@ -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);