From ddca3c1e01ecd7773544d488f1c4b93b997e63e4 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 19 Jun 2016 12:51:27 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@37750 git-svn-id: http://core.svn.wordpress.org/trunk@37715 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/compat.php | 5 ++++- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/compat.php b/wp-includes/compat.php index ad49ba3a0b..407e1779db 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -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 { diff --git a/wp-includes/version.php b/wp-includes/version.php index b2deacf692..fe9f2ce41e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37749'; +$wp_version = '4.6-alpha-37750'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.