[wp-trac] [WordPress Trac] #62824: single_month_title() can cause a warning.

WordPress Trac noreply at wordpress.org
Tue Feb 25 22:38:59 UTC 2025


#62824: single_month_title() can cause a warning.
-----------------------------------------+-----------------------
 Reporter:  apermo                       |       Owner:  audrasjb
     Type:  defect (bug)                 |      Status:  closed
 Priority:  normal                       |   Milestone:  6.8
Component:  Date/Time                    |     Version:  2.1
 Severity:  normal                       |  Resolution:  fixed
 Keywords:  has-patch changes-requested  |     Focuses:
-----------------------------------------+-----------------------
Changes (by audrasjb):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"59870" 59870]:
 {{{
 #!CommitTicketReference repository="" revision="59870"
 Date/Time: Add sanitization to `WP_Locale::get_month()`.

 By adding a sanitization to `$wp_locale->get_month()`, this changeset
 prevents a PHP Warning: `Undefined array key "00"` caused by
 `single_month_title()`. This function previously assumed that
 `get_query_var( 'm' )` is always at least 6 digits, and always contains
 the year and the month, which is not necessarily true.

 Props apermo, audrasjb, xateman.
 Fixes #62824.
 }}}

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


More information about the wp-trac mailing list