[wp-trac] Re: [WordPress Trac] #6527: Publishing directly sets wrong date on 'post_date_gmt'

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 10 08:06:06 GMT 2008


#6527: Publishing directly sets wrong date on 'post_date_gmt'
-----------------------------+----------------------------------------------
 Reporter:  arabek           |        Owner:  anonymous
     Type:  defect           |       Status:  new      
 Priority:  highest omg bbq  |    Milestone:  2.5.1    
Component:  General          |      Version:  2.5      
 Severity:  critical         |   Resolution:           
 Keywords:                   |  
-----------------------------+----------------------------------------------
Comment (by techcookies):

 actually, when publishing directly it sets the post_date_gmt right, but if
 the post has been saved (as draft) in the mean time, post_date_gmt is left
 at '0000-00-00 00:00:00'. I think the bug is in wp-includes/post.php at
 line 1234, where it checks for empty(post_date_gmt). When post has been
 saved for the first time (i.e. as draft), post_date_gmt won't be empty,
 but will contain '0000-00-00 00:00:00'.

 So the line should read

 if (empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt) {

 I will post a patch for review.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6527#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list