From cdcba6846c76e19e09a503f9b9cda9905b13a6a4 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 1 May 2015 22:14:21 -0400 Subject: [PATCH] Bug 14118: Silence warnings t/DataTables/Members.t After cleaning 'prove t' up. 'prove -r t' was attempted next. A couple uninitialized variable warning were triggered. TEST PLAN ---------- 1) prove t/DataTables/Members.t -- warnings. 2) apply patch 3) prove t/DataTables/Members.t -- no warnings. 4) koha qa test tools. Signed-off-by: Bernardo Gonzalez Kriegel Cleaned. No errors Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- C4/Utils/DataTables/Members.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index 767fc4635d..a63a582c55 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -103,10 +103,10 @@ sub search { my $limit; # If iDisplayLength == -1, we want to display all patrons - if ( $dt_params->{iDisplayLength} > -1 ) { + if ( !$dt_params->{iDisplayLength} || $dt_params->{iDisplayLength} > -1 ) { # In order to avoid sql injection - $dt_params->{iDisplayStart} =~ s/\D//g; - $dt_params->{iDisplayLength} =~ s/\D//g; + $dt_params->{iDisplayStart} =~ s/\D//g if defined($dt_params->{iDisplayStart}); + $dt_params->{iDisplayLength} =~ s/\D//g if defined($dt_params->{iDisplayLength}); $dt_params->{iDisplayStart} //= 0; $dt_params->{iDisplayLength} //= 20; $limit = "LIMIT $dt_params->{iDisplayStart},$dt_params->{iDisplayLength}"; -- 2.39.5