Fixed HTTPS related issues in ms-blogs.php
-
Two functions in ms-blogs.php have issues due to hard-coding “https://” versus using the is_ssl() check. I have corrected them below. Just copy and paste these over the ones in your ms-blogs.php, if you require this functionality.
function get_blogaddress_by_id( $blog_id ) { $protocol = is_ssl() ? 'https://' : 'https://'; $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details! return esc_url( $protocol . $bloginfo->domain . $bloginfo->path ); } function get_blogaddress_by_domain( $domain, $path ){ $protocol = is_ssl() ? 'https://' : 'https://'; if ( is_subdomain_install() ) { $url = $protocol.$domain.$path; } else { if ( $domain != $_SERVER['HTTP_HOST'] ) { $blogname = substr( $domain, 0, strpos( $domain, '.' ) ); $url = $protocol . substr( $domain, strpos( $domain, '.' ) + 1 ) . $path; // we're not installing the main blog if ( $blogname != 'www.' ) $url .= $blogname . '/'; } else { // main blog $url = $protocol . $domain . $path; } } return esc_url( $url ); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fixed HTTPS related issues in ms-blogs.php’ is closed to new replies.