[wp-trac] [WordPress Trac] #37634: Wrong usage of $gmt parameter in date_i18n() in options-general.php

WordPress Trac noreply at wordpress.org
Thu Aug 11 12:40:00 UTC 2016


#37634: Wrong usage of $gmt parameter in date_i18n() in options-general.php
----------------------------------------+------------------------------
 Reporter:  swissspidy                  |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Administration              |     Version:  3.1
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+------------------------------

Comment (by jdgrimes):

 Note that the `$gmt` parameter is still needed for these lines in
 `date_i18n()`:

 {{{#!php
 <?php
     if ( false === $i ) {
         if ( ! $gmt )
             $i = current_time( 'timestamp' );
         else
             $i = time();
         // we should not let date() interfere with our
         // specially computed timestamp
         $gmt = true;
     }
 }}}


 However, they could be simplified to just:

 {{{#!php
 <?php
     if ( false === $i ) {
         $i = current_time( 'timestamp', $gmt );
     }
 }}}

 I guess maybe we'll want to open a separate ticket for that though.

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


More information about the wp-trac mailing list