RSS

(root)/bugzilla/sightings : 6820 : post_bug.cgi

To get this branch, use:
bzr branch /bugzilla/sightings

« back to all changes in this revision

Viewing changes to post_bug.cgi

mkanat%bugzilla.org
2009-11-10 13:21:52
Revision ID: cvs-1:mkanatbugzilla.org-20091110212152-qrl6l22h7ck7z2iv
Bug 526165: Make it impossible to set creation_ts via Bugzilla::Bug->create
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat

Show diffs side-by-side

added added

removed removed

103
103
 
104
104
umask 0;
105
105
 
106
 
# get current time
107
 
my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
108
 
 
109
106
# Group Validation
110
107
my @selected_groups;
111
108
foreach my $group (grep(/^bit-\d+$/, $cgi->param())) {
160
157
foreach my $field (@bug_fields) {
161
158
    $bug_params{$field} = $cgi->param($field);
162
159
}
163
 
$bug_params{'creation_ts'} = $timestamp;
164
160
$bug_params{'cc'}          = [$cgi->param('cc')];
165
161
$bug_params{'groups'}      = \@selected_groups;
166
162
$bug_params{'comment'}     = $comment;
176
172
 
177
173
# Get the bug ID back.
178
174
my $id = $bug->bug_id;
 
175
# We do this directly from the DB because $bug->creation_ts has the seconds
 
176
# formatted out of it (which should be fixed some day).
 
177
my $timestamp = $dbh->selectrow_array(
 
178
    'SELECT creation_ts FROM bugs WHERE bug_id = ?', undef, $id);
179
179
 
180
180
# Set Version cookie, but only if the user actually selected
181
181
# a version on the page.

Loggerhead 1.18.1 is a web-based interface for Bazaar branches