From: Frédéric Buclin Date: Mon, 18 Jul 2011 00:35:05 +0000 (+0200) Subject: Bug 561170: Fix various warnings thrown with Perl 5.12 X-Git-Tag: bugzilla-4.0.2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e868b887188e1ab2fb6fc3208ab7b3b804bfe7a;p=thirdparty%2Fbugzilla.git Bug 561170: Fix various warnings thrown with Perl 5.12 r=dkl a=LpSolit --- diff --git a/long_list.cgi b/long_list.cgi index 7e1f69534e..58bd255a30 100755 --- a/long_list.cgi +++ b/long_list.cgi @@ -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); diff --git a/summarize_time.cgi b/summarize_time.cgi index 6f9580ac29..dd8ba741b4 100755 --- a/summarize_time.cgi +++ b/summarize_time.cgi @@ -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.