From 22874716dd71b4276b6d0449573f767902a577c0 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Thu, 15 Oct 2015 22:07:24 +0000 Subject: [PATCH] Multisite: Remove the strictness for `$using_paths` in `WP_Network::get_by_path()`. The network lookup was broken when using an external object cache because `$using_paths` isn't always a boolean. Added in [34099]. See #31985, #31491. Built from https://develop.svn.wordpress.org/trunk@35212 git-svn-id: http://core.svn.wordpress.org/trunk@35178 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-network.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/class-wp-network.php b/wp-includes/class-wp-network.php index a60c1ae223..26b125b648 100644 --- a/wp-includes/class-wp-network.php +++ b/wp-includes/class-wp-network.php @@ -209,13 +209,13 @@ class WP_Network { if ( wp_using_ext_object_cache() ) { $using_paths = wp_cache_get( 'networks_have_paths', 'site-options' ); if ( false === $using_paths ) { - $using_paths = $wpdb->get_var( "SELECT id FROM {$wpdb->site} WHERE path <> '/' LIMIT 1" ); - wp_cache_add( 'networks_have_paths', (int) $using_paths, 'site-options' ); + $using_paths = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} WHERE path <> '/' LIMIT 1" ); + wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' ); } } $paths = array(); - if ( true === $using_paths ) { + if ( $using_paths ) { $path_segments = array_filter( explode( '/', trim( $path, '/' ) ) ); /** @@ -272,7 +272,7 @@ class WP_Network { $search_domains = "'" . implode( "', '", $wpdb->_escape( $domains ) ) . "'"; - if ( false === $using_paths ) { + if ( ! $using_paths ) { $network = $wpdb->get_row( " SELECT * FROM {$wpdb->site} WHERE domain IN ({$search_domains}) diff --git a/wp-includes/version.php b/wp-includes/version.php index 1598cb9fab..6ef95aa048 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35211'; +$wp_version = '4.4-alpha-35212'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.