Make WordPress Core

Ticket #30566: fix-notice.30566.diff

File fix-notice.30566.diff, 529 bytes (added by nerrad, 10 years ago)

fix php notice for get_blogaddress_by_id with invalid id.

  • src/wp-includes/ms-blogs.php

    diff --git src/wp-includes/ms-blogs.php src/wp-includes/ms-blogs.php
    index e1c70e1..a655068 100644
    function wpmu_update_blogs_date() { 
    3737 */
    3838function get_blogaddress_by_id( $blog_id ) {
    3939        $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
    40         return esc_url( 'http://' . $bloginfo->domain . $bloginfo->path );
     40        return ! empty( $bloginfo ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
    4141}
    4242
    4343/**