summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-11-10 22:21:52 +0100
committermkanat%bugzilla.org <>2009-11-10 22:21:52 +0100
commite4dfffc24ca572965c513356c7c8a19f82a22c64 (patch)
tree4a3718d3a9d18d83f986c0ade9993a5432ac6f15 /post_bug.cgi
parent4b2c9f0f96242fcd5395c088de4e27bffbfb8085 (diff)
downloadbugzilla-e4dfffc24ca572965c513356c7c8a19f82a22c64.tar.gz
bugzilla-e4dfffc24ca572965c513356c7c8a19f82a22c64.tar.xz
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
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi8
1 files changed, 4 insertions, 4 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index a482913cd..ed483aec9 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -103,9 +103,6 @@ if (defined $cgi->param('maketemplate')) {
umask 0;
-# get current time
-my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
-
# Group Validation
my @selected_groups;
foreach my $group (grep(/^bit-\d+$/, $cgi->param())) {
@@ -160,7 +157,6 @@ my %bug_params;
foreach my $field (@bug_fields) {
$bug_params{$field} = $cgi->param($field);
}
-$bug_params{'creation_ts'} = $timestamp;
$bug_params{'cc'} = [$cgi->param('cc')];
$bug_params{'groups'} = \@selected_groups;
$bug_params{'comment'} = $comment;
@@ -176,6 +172,10 @@ my $bug = Bugzilla::Bug->create(\%bug_params);
# Get the bug ID back.
my $id = $bug->bug_id;
+# We do this directly from the DB because $bug->creation_ts has the seconds
+# formatted out of it (which should be fixed some day).
+my $timestamp = $dbh->selectrow_array(
+ 'SELECT creation_ts FROM bugs WHERE bug_id = ?', undef, $id);
# Set Version cookie, but only if the user actually selected
# a version on the page.