diff options
author | lpsolit%gmail.com <> | 2005-05-11 05:30:11 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-05-11 05:30:11 +0200 |
commit | a32c764ba4f84270e5730e643d099b46313e071a (patch) | |
tree | 69f13d696a293e47c41f2ab1af483628e9f87752 /process_bug.cgi | |
parent | d5c3b178067c1d9c0c7f5cf7756c1969443410fd (diff) | |
download | bugzilla-a32c764ba4f84270e5730e643d099b46313e071a.tar.gz bugzilla-a32c764ba4f84270e5730e643d099b46313e071a.tar.xz |
Bug 287487: User with no privs can not add comments to bugs that have a deadline field set - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 05f4fec0d..451613e29 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1185,7 +1185,13 @@ foreach my $id (@idlist) { my %formhash; foreach my $col (@::log_columns) { # Consider NULL db entries to be equivalent to the empty string - $oldvalues[$i] = '' unless defined $oldvalues[$i]; + $oldvalues[$i] = defined($oldvalues[$i]) ? $oldvalues[$i] : ''; + # Convert the deadline taken from the DB into the YYYY-MM-DD format + # for consistency with the deadline provided by the user, if any. + # Else CheckCanChangeField() would see them as different in all cases. + if ($col eq 'deadline') { + $oldvalues[$i] = format_time($oldvalues[$i], "%Y-%m-%d"); + } $oldhash{$col} = $oldvalues[$i]; $formhash{$col} = $cgi->param($col) if defined $cgi->param($col); $i++; @@ -1717,6 +1723,10 @@ foreach my $id (@idlist) { foreach my $col (@::log_columns) { # Consider NULL db entries to be equivalent to the empty string $newvalues[$i] ||= ''; + # Convert the deadline to the YYYY-MM-DD format. + if ($col eq 'deadline') { + $newvalues[$i] = format_time($newvalues[$i], "%Y-%m-%d"); + } $newhash{$col} = $newvalues[$i]; $i++; } @@ -1779,16 +1789,6 @@ foreach my $id (@idlist) { $check_dep_bugs = 1; } - # Convert deadlines to the YYYY-MM-DD format. We use an - # intermediate $xxxtime to prevent errors in the web - # server log file when str2time($xxx) is undefined. - if ($col eq 'deadline') { - my $oldtime = str2time($old); - $old = ($oldtime) ? time2str("%Y-%m-%d", $oldtime) : ''; - my $newtime = str2time($new); - $new = ($newtime) ? time2str("%Y-%m-%d", $newtime) : ''; - } - LogActivityEntry($id,$col,$old,$new,$whoid,$timestamp); $bug_changed = 1; } |