[wp-trac] [WordPress Trac] #25365: timeAgo attribute for revisions produces the wrong result due to misuse of strtotime

WordPress Trac noreply at wordpress.org
Fri Sep 20 10:59:33 UTC 2013


#25365: timeAgo attribute for revisions produces the wrong result due to misuse of
strtotime
--------------------------+------------------------------
 Reporter:  biranit       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Revisions     |     Version:  3.6.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by biranit):

 I went through ALL instances where strtotime is used in Wordpress 3.6.1
 and found two - possibly three - instances where this error should also be
 fixed:

 1) In '''/wp-includes/comment.php line 2047''':


 {{{
 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old *
 DAY_IN_SECONDS ) ) {
 }}}

 should be changed to


 {{{
 if ( time() - strtotime( $posts[0]->post_date_gmt . " UTC" ) > ( $days_old
 * DAY_IN_SECONDS ) ) {
 }}}

 2) In '''/wp-includes/media.php lines 1661-1662''':


 {{{
 'date'        => strtotime( $attachment->post_date_gmt ) * 1000,
 'modified'    => strtotime( $attachment->post_modified_gmt ) * 1000,

 }}}

 Should be changed to


 {{{
 'date'        => strtotime( $attachment->post_date_gmt . " UTC") * 1000,
 'modified'    => strtotime( $attachment->post_modified_gmt . " UTC") *
 1000,
 }}}

 2) In '''/wp-content/plugins/akismet/akismet.php line 385''':


 {{{
 $last_updated = strtotime( $post->post_modified_gmt );
 }}}

 Should be changed to


 {{{
 $last_updated = strtotime( $post->post_modified_gmt . " UTC");
 }}}

 Thank you

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


More information about the wp-trac mailing list