From f75321f3ec6ad35e8a09fd73abfab637944b1541 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Thu, 15 Oct 2015 22:06:38 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@35212 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-network.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/class-wp-network.php b/src/wp-includes/class-wp-network.php index a60c1ae223..26b125b648 100644 --- a/src/wp-includes/class-wp-network.php +++ b/src/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})