From 1a930c5d4300492f18bec3b127205b696a045fc3 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 14 Jan 2015 05:32:19 +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 git-svn-id: https://develop.svn.wordpress.org/trunk@31178 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-blogs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php index 83fec396ab..4b0bdbc8d9 100644 --- a/src/wp-includes/ms-blogs.php +++ b/src/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;