Bug 18854: Protect few other occurrences of offset

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-07-10 11:56:46 -03:00
parent aabf001232
commit 9f47bd8825
5 changed files with 9 additions and 5 deletions

View File

@ -240,7 +240,7 @@ sub SearchAuthorities {
$query="\@or $orderstring $query" if $orderstring;
}
$offset=0 unless $offset;
$offset = 0 if not defined $offset or $offset < 0;
my $counter = $offset;
$length=10 unless $length;
my @oAuth;

View File

@ -327,7 +327,8 @@ sub simple_search_compat {
return ('No query entered', undef, undef) unless $query;
my %options;
$options{offset} = $offset // 0;
$offset = 0 if not defined $offset or $offset < 0;
$options{offset} = $offset;
$max_results //= 100;
unless (ref $query) {

View File

@ -52,7 +52,8 @@ my $input = new CGI;
my $tagfield = $input->param('tagfield');
my $tagsubfield = $input->param('tagsubfield');
my $authtypecode = $input->param('authtypecode');
my $offset = $input->param('offset') || 0;
my $offset = $input->param('offset');
$offset = 0 if not defined $offset or $offset < 0;
my $op = $input->param('op') || '';
my $script_name = "/cgi-bin/koha/admin/auth_subfields_structure.pl";

View File

@ -35,7 +35,8 @@ my $authtypecode = $input->param('authtypecode') || ''; # set
my $existingauthtypecode = $input->param('existingauthtypecode') || ''; # set when we have to create a new framework (in authtype) by copying an old one (in existingauthtype)
my $searchfield = $input->param('searchfield') || 0;
my $offset = $input->param('offset') || 0;
my $offset = $input->param('offset');
$offset = 0 if not defined $offset or $offset < 0;
my $op = $input->param('op') || '';
$searchfield =~ s/\,//g;

View File

@ -65,7 +65,8 @@ my $tagfield = $input->param('tagfield');
my $tagsubfield = $input->param('tagsubfield');
my $frameworkcode = $input->param('frameworkcode');
my $pkfield = "tagfield";
my $offset = $input->param('offset') || 0;
my $offset = $input->param('offset');
$offset = 0 if not defined $offset or $offset < 0;
my $script_name = "/cgi-bin/koha/admin/marc_subfields_structure.pl";
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(