WordPress.org

Make WordPress Core

Changeset 37750


Ignore:
Timestamp:
06/19/2016 12:50:15 PM (4 years ago)
Author:
swissspidy
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r37748 r37750  
    472472
    473473                foreach ( array_keys( $head ) as $key ) {
    474                     if ( isset( $key, $bref ) && is_array( $bref[ $key ] ) && is_array( $head[ $key ] ) ) {
     474                    if ( isset( $key, $bref ) &&
     475                         isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
     476                         isset( $head[ $key ] ) && is_array( $head[ $key ] )
     477                    ) {
    475478                        $bref_stack[] = &$bref[ $key ];
    476479                        $head_stack[] = $head[ $key ];
Note: See TracChangeset for help on using the changeset viewer.