Make WordPress Core

Changeset 31178


Ignore:
Timestamp:
01/14/2015 05:32:19 AM (10 years ago)
Author:
jeremyfelt
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-blogs.php

    r31158 r31178  
    3838function get_blogaddress_by_id( $blog_id ) {
    3939    $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
    40     return isset( $bloginfo->domain ) && isset( $bloginfo->path ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
     40    return ( $bloginfo ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
    4141}
    4242
     
    100100 * @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.
    101101 * @param bool $get_all Whether to retrieve all details or only the details in the blogs table. Default is true.
    102  * @return object Blog details.
     102 * @return object|false Blog details on success. False on failure.
    103103 */
    104104function get_blog_details( $fields = null, $get_all = true ) {
Note: See TracChangeset for help on using the changeset viewer.