]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 561170: Fix various warnings thrown with Perl 5.12
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 18 Jul 2011 00:35:05 +0000 (02:35 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 18 Jul 2011 00:35:05 +0000 (02:35 +0200)
r=dkl a=LpSolit

long_list.cgi
summarize_time.cgi

index 7e1f69534e3445e4d1baf5ef742be326513b4c58..58bd255a3011a21c5c1c118ed522a6095637cbf9 100755 (executable)
@@ -28,7 +28,7 @@ use Bugzilla;
 my $cgi = Bugzilla->cgi;
 
 # Convert comma/space separated elements into separate params
-my $buglist = $cgi->param('buglist') || $cgi->param('bug_id') || $cgi->param('id');
+my $buglist = $cgi->param('buglist') || $cgi->param('bug_id') || $cgi->param('id') || '';
 my @ids = split (/[\s,]+/, $buglist);
 
 my $ids = join('', map { $_ = "&id=" . $_ } @ids);
index 6f9580ac29edc94dcf06e24478ee8eec89d53f65..dd8ba741b45c568ad7f2502f1685d06125fc532d 100755 (executable)
@@ -264,7 +264,7 @@ $user->is_timetracker
                                        action => "access",
                                        object => "timetracking_summaries"});
 
-my @ids = split(",", $cgi->param('id'));
+my @ids = split(",", $cgi->param('id') || '');
 @ids = map { Bugzilla::Bug->check($_)->id } @ids;
 scalar(@ids) || ThrowUserError('no_bugs_chosen', {action => 'view'});
 
@@ -293,17 +293,17 @@ if ($do_report) {
     $start_date = trim $cgi->param('start_date');
     $end_date = trim $cgi->param('end_date');
 
+    foreach my $date ($start_date, $end_date) {
+        next unless $date;
+        validate_date($date)
+          || ThrowUserError('illegal_date', {date => $date, format => 'YYYY-MM-DD'});
+    }
     # Swap dates in case the user put an end_date before the start_date
     if ($start_date && $end_date && 
         str2time($start_date) > str2time($end_date)) {
         $vars->{'warn_swap_dates'} = 1;
         ($start_date, $end_date) = ($end_date, $start_date);
     }
-    foreach my $date ($start_date, $end_date) {
-        next unless $date;
-        validate_date($date)
-          || ThrowUserError('illegal_date', {date => $date, format => 'YYYY-MM-DD'});
-    }
 
     # Store dates in a session cookie so re-visiting the page
     # for other bugs keeps them around.