Bug 29771: Scalar context for split
This patch tackles a very specific scenario. Calling split(..., CGI::param) makes it be called in list context. The split docs say: split /PATTERN/,EXPR,LIMIT this means the first CGI param will be used as EXPR and the second one as LIMIT, which is wrong anyway. So the fix is to just force scalar context. To test: 1. Not sure, just make sure nothing breaks when using the scripts in the browser. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
1cfa7e3845
commit
e5dc760b92
6 changed files with 6 additions and 6 deletions
|
@ -30,7 +30,7 @@ use Koha::Patrons;
|
|||
|
||||
my $cgi = CGI->new;
|
||||
|
||||
my @ids = split( ',', $cgi->param('id') );
|
||||
my @ids = split( ',', scalar $cgi->param('id') );
|
||||
|
||||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
||||
{
|
||||
|
|
|
@ -75,7 +75,7 @@ $template->param( all_branches => 1 ) if $all_branches;
|
|||
|
||||
if ($cancelBulk) {
|
||||
my $reason = $input->param("cancellation-reason");
|
||||
my @hold_ids = split ',', $input->param("ids");
|
||||
my @hold_ids = split( ',', scalar $input->param("ids") );
|
||||
my $params = {
|
||||
reason => $reason,
|
||||
hold_ids => \@hold_ids,
|
||||
|
|
|
@ -124,7 +124,7 @@ elsif ( $action eq 'toggleSuspend' ) {
|
|||
}
|
||||
elsif ( $action eq 'cancelBulk' ) {
|
||||
my $cancellation_reason = $input->param("cancellation-reason");
|
||||
my @hold_ids = split ',', $input->param("ids");
|
||||
my @hold_ids = split( ',', scalar $input->param("ids"));
|
||||
my $params = {
|
||||
reason => $cancellation_reason,
|
||||
hold_ids => \@hold_ids,
|
||||
|
|
|
@ -85,7 +85,7 @@ if ( $op eq 'form' ) {
|
|||
}
|
||||
} else {
|
||||
# The user enters manually the list of id
|
||||
push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
|
||||
push @record_ids, split( /\s\n/, scalar $input->param('recordnumber_list') );
|
||||
}
|
||||
|
||||
for my $record_id ( uniq @record_ids ) {
|
||||
|
|
|
@ -113,7 +113,7 @@ if ( $op eq 'form' ) {
|
|||
}
|
||||
} else {
|
||||
# The user enters manually the list of id
|
||||
push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
|
||||
push @record_ids, split( /\s\n/, scalar $input->param('recordnumber_list') );
|
||||
}
|
||||
|
||||
for my $record_id ( uniq @record_ids ) {
|
||||
|
|
|
@ -182,7 +182,7 @@ if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length
|
|||
push @uploadedbarcodes, grep { /\S/ } split( /[$split_chars]/, $barcode );
|
||||
}
|
||||
} else {
|
||||
push @uploadedbarcodes, split(/\s\n/, $input->param('barcodelist') );
|
||||
push @uploadedbarcodes, split(/\s\n/, scalar $input->param('barcodelist') );
|
||||
$uploadbarcodes = $barcodelist;
|
||||
}
|
||||
for my $barcode (@uploadedbarcodes) {
|
||||
|
|
Loading…
Reference in a new issue