From 8d55b418ecf538417e21ee96efa2936ea34ff3e8 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 14 Jan 2015 05:33:25 +0000 Subject: [PATCH] Don't overcheck the expected return from `get_blog_details()` in `get_blogaddress_by_id()` If `get_blog_details()` is returning something that is not our expected object or `false`, then a notice would already be thrown there. Also adds proper return docs to `get_blog_details()`. Props SergeyBiryukov. Fixes #30566 Built from https://develop.svn.wordpress.org/trunk@31178 git-svn-id: http://core.svn.wordpress.org/trunk@31159 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-blogs.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 83fec396ab..4b0bdbc8d9 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -37,7 +37,7 @@ function wpmu_update_blogs_date() { */ function get_blogaddress_by_id( $blog_id ) { $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details! - return isset( $bloginfo->domain ) && isset( $bloginfo->path ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : ''; + return ( $bloginfo ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : ''; } /** @@ -99,7 +99,7 @@ function get_id_from_blogname( $slug ) { * * @param int|string|array $fields A blog ID, a blog slug, or an array of fields to query against. Optional. If not specified the current blog ID is used. * @param bool $get_all Whether to retrieve all details or only the details in the blogs table. Default is true. - * @return object Blog details. + * @return object|false Blog details on success. False on failure. */ function get_blog_details( $fields = null, $get_all = true ) { global $wpdb; diff --git a/wp-includes/version.php b/wp-includes/version.php index 59cc774988..3615ba17b1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31177'; +$wp_version = '4.2-alpha-31178'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.