[wp-trac] [WordPress Trac] #14279: wp_new_comment ignores comment_date_gmt and comment_date

WordPress Trac noreply at wordpress.org
Thu Mar 5 02:58:24 UTC 2015


#14279: wp_new_comment ignores comment_date_gmt and comment_date
------------------------------+------------------
 Reporter:  johneckman        |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  4.2
Component:  Comments          |     Version:  3.0
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+------------------

Comment (by boonebgorges):

 This looks pretty good, but I'm going to make a few changes to clean it
 up:

 - Unit tests can be simplified. Modding the environment during `setUp()`
 and `tearDown()` is likely to have unforeseen effects on other tests in
 the class.
 - I'm going to remove the `! strtotime()` checks. I know that this is
 meant as a sort of validation. But (a) as validation it's imperfect, as
 it'll fail for the UNIX epoch, and (b) we don't do this kind of validation
 on dates elsewhere. If someone enters an invalid date, MySQL will convert
 it to `0000-00-00 00:00:00`, which IMO is better behavior than silently
 swapping out the intended date for the current date.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/14279#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list