• Resolved Mark C

    (@mareck)


    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)
  • You may want to open up a trac ticket about this. Putting this up on the forums does little good since the developers don;pt normally hang out here.

    I;d leave a link to the trac but am getting tired of having to ‘modlook’ every time I do so since they get caught by the antispam system.

    Thread Starter Mark C

    (@mareck)

    Right, I had intended to add it to trac, just wanted to put it in the forum for folks needing it before a new release…

    It’s in trac: Ticket #14867

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fixed HTTPS related issues in ms-blogs.php’ is closed to new replies.