WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#19751 closed defect (bug) (wontfix)

Notice: Undefined index: 00 in /Users/mark/Sites/wp.git/wp-includes/locale.php on line 266

Reported by: markjaquith Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:

Description

Got this notice:

Notice: Undefined index: 00 in /Users/mark/Sites/wp.git/wp-includes/locale.php on line 266

Must be passing a 0 in to get_month() which means that '00' is not a valid index in the month name array.

Attachments (1)

19751.diff (497 bytes) - added by markjaquith 2 years ago.
Check the array before using its member.

Download all attachments as: .zip

Change History (6)

markjaquith2 years ago

Check the array before using its member.

comment:1 nacin2 years ago

I imagine get_month(13) would also generate a notice. Looks like a number of methods in WP_Locale are susceptible.

That said, get_month( 0 ) is an invalid call to the method. It specifically wants 1-12 (leading zero optional). To me, the notice is proper here, rather than masking an incorrect call and making it harder to track down.

comment:2 SergeyBiryukov2 years ago

This seems similar to #17299, where the consensus was to keep the warning as well.

comment:3 jkudish2 years ago

  • Keywords has-patch added

comment:4 markjaquith2 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix, as this is probably a situation where we do want a notice, because it's not normal.

comment:5 helenyhou2 years ago

  • Milestone 3.4 deleted
Note: See TracTickets for help on using tickets.