Lines 30-35
use Koha::Libraries;
Link Here
|
30 |
use Koha::Token; |
30 |
use Koha::Token; |
31 |
|
31 |
|
32 |
use Try::Tiny; |
32 |
use Try::Tiny; |
|
|
33 |
use URI::Escape; |
33 |
|
34 |
|
34 |
our $cgi = CGI->new; |
35 |
our $cgi = CGI->new; |
35 |
my $illRequests = Koha::Illrequests->new; |
36 |
my $illRequests = Koha::Illrequests->new; |
Lines 270-287
if ( $backends_available ) {
Link Here
|
270 |
|
271 |
|
271 |
# If we receive a pre-filter, make it available to the template |
272 |
# If we receive a pre-filter, make it available to the template |
272 |
my $possible_filters = ['borrowernumber']; |
273 |
my $possible_filters = ['borrowernumber']; |
273 |
my $active_filters = []; |
274 |
my $active_filters = {}; |
274 |
foreach my $filter(@{$possible_filters}) { |
275 |
foreach my $filter(@{$possible_filters}) { |
275 |
if ($params->{$filter}) { |
276 |
if ($params->{$filter}) { |
276 |
push @{$active_filters}, "$filter=$params->{$filter}"; |
277 |
# We shouldn't need to escape $filter here since we're using |
|
|
278 |
# a whitelist, but just to be sure... |
279 |
$active_filters->{uri_escape_utf8($filter)} = |
280 |
uri_escape_utf8(scalar $params->{$filter}); |
277 |
} |
281 |
} |
278 |
} |
282 |
} |
279 |
if (scalar @{$active_filters} > 0) { |
283 |
if (keys %{$active_filters}) { |
280 |
$template->param( |
284 |
my @tpl_arr; |
281 |
prefilters => join(",", @{$active_filters}) |
285 |
foreach my $key (keys %{$active_filters}) { |
282 |
); |
286 |
push @tpl_arr, $key . "=" . $active_filters->{$key}; |
|
|
287 |
} |
283 |
} |
288 |
} |
284 |
|
289 |
$template->param( |
|
|
290 |
prefilters => join("&", @tpl_arr) |
291 |
); |
285 |
} elsif ( $op eq "save_comment" ) { |
292 |
} elsif ( $op eq "save_comment" ) { |
286 |
die "Wrong CSRF token" unless Koha::Token->new->check_csrf({ |
293 |
die "Wrong CSRF token" unless Koha::Token->new->check_csrf({ |
287 |
session_id => scalar $cgi->cookie('CGISESSID'), |
294 |
session_id => scalar $cgi->cookie('CGISESSID'), |