Bug 20701: (17.11 follow-up) Move csrf token after checkauth and use

scalar

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2018-05-23 10:37:35 +00:00
parent 873da065b8
commit 5f846a33ab
2 changed files with 6 additions and 6 deletions

View File

@ -55,7 +55,7 @@ if ($add){
die "Wrong CSRF token"
unless Koha::Token->new->check_csrf( {
session_id => $input->cookie('CGISESSID'),
session_id => scalar $input->cookie('CGISESSID'),
token => scalar $input->param('csrf_token'),
});

View File

@ -51,12 +51,12 @@ unless ( $patron ) {
my $add=$input->param('add');
if ($add){
die "Wrong CSRF token"
unless Koha::Token->new->check_csrf( {
session_id => $input->cookie('CGISESSID'),
token => scalar $input->param('csrf_token'),
});
if ( checkauth( $input, 0, $flagsrequired, 'intranet' ) ) {
die "Wrong CSRF token"
unless Koha::Token->new->check_csrf( {
session_id => scalar $input->cookie('CGISESSID'),
token => scalar $input->param('csrf_token'),
});
# print $input->header;
my $barcode=$input->param('barcode');
my $itemnum;