]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 315317: DBI placeholders break AppendComment's default timestamp - Patch by Frédé...
authorlpsolit%gmail.com <>
Wed, 22 Feb 2006 00:40:04 +0000 (00:40 +0000)
committerlpsolit%gmail.com <>
Wed, 22 Feb 2006 00:40:04 +0000 (00:40 +0000)
Bugzilla/Bug.pm

index cab54d7dab19e7e269f25f43c4f59e9423b73c94..f75c1ad0b2e13d5ba880991d89c6797c2df529e5 100755 (executable)
@@ -23,7 +23,7 @@
 #                 Bradley Baetz  <bbaetz@acm.org>
 #                 Dave Miller    <justdave@bugzilla.org>
 #                 Max Kanat-Alexander <mkanat@bugzilla.org>
-#                 Frédéric Buclin <LpSolit@gmail.com>
+#                 Frédéric Buclin <LpSolit@gmail.com>
 #                 Lance Larsh <lance.larsh@oracle.com>
 
 package Bugzilla::Bug;
@@ -717,7 +717,7 @@ sub AppendComment {
 
     # Use the date/time we were given if possible (allowing calling code
     # to synchronize the comment's timestamp with those of other records).
-    $timestamp =  "NOW()" unless $timestamp;
+    $timestamp ||= $dbh->selectrow_array('SELECT NOW()');
 
     $comment =~ s/\r\n/\n/g;     # Handle Windows-style line endings.
     $comment =~ s/\r/\n/g;       # Handle Mac-style line endings.
@@ -737,7 +737,7 @@ sub AppendComment {
     $dbh->do("UPDATE bugs SET delta_ts = ? WHERE bug_id = ?",
              undef, $timestamp, $bugid);
 }
-\r
+
 # This method is private and is not to be used outside of the Bug class.
 sub EmitDependList {
     my ($myfield, $targetfield, $bug_id) = (@_);