Make WordPress Core

Ticket #33041: with-test.diff

File with-test.diff, 1.3 KB (added by AD7six, 9 years ago)
  • src/wp-includes/ms-blogs.php

     
    3939 */
    4040function get_blogaddress_by_id( $blog_id ) {
    4141        $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
    42         return ( $bloginfo ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
     42        return ( $bloginfo ) ? esc_url( set_url_scheme( 'http://' . $bloginfo->domain . $bloginfo->path ) ) : '';
    4343}
    4444
    4545/**
  • tests/phpunit/tests/multisite/site.php

     
    11801180        }
    11811181
    11821182        /**
     1183         * Tests returning an address for a given valid id on a https setup
     1184         *
     1185         * @backupGlobals enabled
     1186         */
     1187        function test_get_blogaddress_by_id_with_valid_id_https() {
     1188                $_SERVER['HTTPS'] = 'on';
     1189                $blogaddress = get_blogaddress_by_id( 1 );
     1190                $this->assertEquals( 'https://' . WP_TESTS_DOMAIN . '/', $blogaddress );
     1191        }
     1192
     1193        /**
    11831194         * Tests returning the appropriate response for a invalid id given.
    11841195         */
    11851196        function test_get_blogaddress_by_id_with_invalid_id() {