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
This commit is contained in:
Scott Taylor 2015-09-27 18:13:24 +00:00
parent 1b6ed5cbb7
commit d6774f0f6d
2 changed files with 2 additions and 2 deletions

View File

@ -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 ) . '"' : '';

View File

@ -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.