Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#31257 closed enhancement (fixed)

Variable initialized with value of inappropriate type

Reported by: ipm-frommen's profile ipm-frommen Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.2 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Everywhere in the _wp_menu_output function, the $submenu_items variable is treated like an array; so why not initialize it with array(), instead of false?

There are several ! empty( $submenu_items ) checks, and these work perfectly fine with $submenu_items being an empty array.

Attachments (1)

31257.patch (528 bytes) - added by ipm-frommen 10 years ago.

Download all attachments as: .zip

Change History (4)

@ipm-frommen
10 years ago

#1 @ipm-frommen
10 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
10 years ago

  • Component changed from Menus to Administration
  • Focuses template removed
  • Milestone changed from Awaiting Review to 4.2

#3 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 31364:

In _wp_menu_output(), $submenu_items is an array and should be initialized as such.

props ipm-frommen.
fixes #31257.

Note: See TracTickets for help on using tickets.