Menus: Fix `_wp_expand_nav_menu_post_data()` for PHP 5.2.

[37748] introduced `_wp_expand_nav_menu_post_data()` together with an `array_replace_recursive()` compatibility function for PHP 5.2.
Even though that compat function is tried and tested in other projects like BuddyPress, we need to add additional `isset()` checks in order to avoid 'Undefined index' notices in our case.

See #36590.

git-svn-id: https://develop.svn.wordpress.org/trunk@37750 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2016-06-19 12:50:15 +00:00
parent 7e53f5e404
commit 6bf5465f67
1 changed files with 4 additions and 1 deletions

View File

@ -471,7 +471,10 @@ if ( ! function_exists( 'array_replace_recursive' ) ) :
unset( $bref_stack[ key( $bref_stack ) ] );
foreach ( array_keys( $head ) as $key ) {
if ( isset( $key, $bref ) && is_array( $bref[ $key ] ) && is_array( $head[ $key ] ) ) {
if ( isset( $key, $bref ) &&
isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
isset( $head[ $key ] ) && is_array( $head[ $key ] )
) {
$bref_stack[] = &$bref[ $key ];
$head_stack[] = $head[ $key ];
} else {