From d6774f0f6dbb40db4f4eab9d237219a6bfcfabff Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 27 Sep 2015 18:13:24 +0000 Subject: [PATCH] Nav Menus: in `wp_nav_menu()`, `$container` is already bound to a list of allowed tags. PHP, being its whimsical self, while return `true` if someone sets `$container` to `true` via `in_array( true, [ 'div', 'nav' ] )`. Check that `$container` is a string before the `in_array()` check. `'true'` does not pass. Props shedonist for the original patch. Fixes #32464. Built from https://develop.svn.wordpress.org/trunk@34630 git-svn-id: http://core.svn.wordpress.org/trunk@34594 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 12ab81d4ac..13a9e735f4 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -334,7 +334,7 @@ function wp_nav_menu( $args = array() ) { * Default is array containing 'div' and 'nav'. */ $allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) ); - if ( in_array( $args->container, $allowed_tags ) ) { + if ( is_string( $args->container ) && in_array( $args->container, $allowed_tags ) ) { $show_container = true; $class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-'. $menu->slug .'-container"'; $id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index 65d0a95209..bf00ced83f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34629'; +$wp_version = '4.4-alpha-34630'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.