Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#31630 closed defect (bug) (duplicate)

Need variable validation in nav-menu-template.php

Reported by: rpayne7264 Owned by:
Priority: normal Milestone:
Component: Menus Version: 4.1.1
Severity: normal Keywords:
Cc: Focuses:

Description

Getting the following on a site, while using RDP Wiki-Press Embed plugin in 'Wordpress Page' mode, which creates a non-existent dummy page to display scraped wiki content:

Warning: in_array() expects parameter 2 to be array, null given in nav-menu-template.php on line 607

Change History (5)

#1 @SergeyBiryukov
12 years ago

  • Component GeneralMenus
  • Summary Wordpress Bug - need variable validation in nav-menu-template.phpNeed variable validation in nav-menu-template.php

#2 follow-up: @DrewAPicture
11 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

Hi Robert,

This is an issue with the RDP Wiki-Press Embed plugin. I'd suggest visiting that plugin's support forums and re-asking your question there.

#3 follow-up: @rpayne7264
11 years ago

  • Resolution invalid
  • Status closedreopened

No, this is not an issue with my plugin. It is an issue of sloppy, non-defensive coding in the WP core files. There needs to be a check that $queried_object->ancestors is an array, before calling the is_array() function. Or, the $queried_object code needs to be refactored to ensure an empty array is returned, instead of null.

#4 in reply to: ↑ 2 @rpayne7264
11 years ago

No, this is not an issue with my plugin. It is an issue of sloppy, non-defensive coding in the WP core files. There needs to be a check that $queried_object->ancestors is an array, before calling the is_array() function. Or, the $queried_object code needs to be refactored to ensure an empty array is returned, instead of null.

Replying to DrewAPicture:

Hi Robert,

This is an issue with the RDP Wiki-Press Embed plugin. I'd suggest visiting that plugin's support forums and re-asking your question there.

#5 in reply to: ↑ 3 @DrewAPicture
11 years ago

  • Resolutionduplicate
  • Status reopenedclosed

Replying to rpayne7264:

There needs to be a check that $queried_object->ancestors is an array, before calling the is_array() function. Or, the $queried_object code needs to be refactored to ensure an empty array is returned, instead of null.

Fair enough. This is a duplicate of #24548.

Note: See TracTickets for help on using tickets.