From dcb07b50e043893ff849b16890f9ea3c6aadc647 Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Wed, 14 Aug 2002 20:42:28 +0000 Subject: Bug 153578 - Attachment modified date is meant to be attachment creation date r=preed, joel --- attachment.cgi | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index 8a6c1b033..5614549e4 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -382,11 +382,6 @@ sub viewall ($a{'attachid'}, $a{'date'}, $a{'contenttype'}, $a{'description'}, $a{'ispatch'}, $a{'isobsolete'}) = FetchSQLData(); - # Format the attachment's creation/modification date into something readable. - if ($a{'date'} =~ /^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) { - $a{'date'} = "$3/$4/$2 $5:$6"; - } - # Flag attachments as to whether or not they can be viewed (as opposed to # being downloaded). Currently I decide they are viewable if their MIME type # is either text/*, image/*, or application/vnd.mozilla.*. @@ -480,8 +475,8 @@ sub insert my $thedata = SqlQuote($::FORM{'data'}); # Insert the attachment into the database. - SendSQL("INSERT INTO attachments (bug_id, filename, description, mimetype, ispatch, submitter_id, thedata) - VALUES ($::FORM{'bugid'}, $filename, $description, $contenttype, $::FORM{'ispatch'}, $::userid, $thedata)"); + SendSQL("INSERT INTO attachments (bug_id, creation_ts, filename, description, mimetype, ispatch, submitter_id, thedata) + VALUES ($::FORM{'bugid'}, now(), $filename, $description, $contenttype, $::FORM{'ispatch'}, $::userid, $thedata)"); # Retrieve the ID of the newly created attachment record. SendSQL("SELECT LAST_INSERT_ID()"); @@ -676,8 +671,7 @@ sub update SET description = $quoteddescription , mimetype = $quotedcontenttype , ispatch = $::FORM{'ispatch'} , - isobsolete = $::FORM{'isobsolete'} , - creation_ts = creation_ts + isobsolete = $::FORM{'isobsolete'} WHERE attach_id = $::FORM{'id'} "); -- cgit v1.2.3-24-g4f1b