[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 07:51:57 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          |   Keywords:  needs-patch good-first-bug
  Focuses:                  |
----------------------------+----------------------------------------
 For showing the universal time on the "General Settings" screen, the
 following code is used:

 {{{#!php
 date_i18n( $timezone_format, false, 'gmt' )
 }}}

 However, the third parameter, `$gmt` is actually a ''boolean'' has been
 that way ever since 0.71.

 It should therefore look like this:

 {{{#!php
 date_i18n( $timezone_format, false, true )
 }}}

 It currently only works because of this line in `date_i18n`, where `gmt`
 is implicitly `true` and thus `gmdate` is used:

 {{{#!php
 $datefunc = $gmt? 'gmdate' : 'date';
 }}}


 Introduced in [9616].

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


More information about the wp-trac mailing list