]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post.php
WordPress 4.2.2
[autoinstalls/wordpress.git] / wp-includes / post.php
index 7b6575366a8b9d764d909b4529a7ea14daf12fc9..d0ecd2e04e7678e4abb6395ed9a63e5b0eac32fb 100644 (file)
@@ -4992,12 +4992,9 @@ function wp_get_attachment_url( $post_id = 0 ) {
                $url = get_the_guid( $post->ID );
        }
 
                $url = get_the_guid( $post->ID );
        }
 
-       /*
-        * If currently on SSL, prefer HTTPS URLs when we know they're supported by the domain
-        * (which is to say, when they share the domain name of the current SSL page).
-        */
-       if ( is_ssl() && 'https' !== substr( $url, 0, 5 ) && parse_url( $url, PHP_URL_HOST ) === $_SERVER['HTTP_HOST'] ) {
-               $url = set_url_scheme( $url, 'https' );
+       // On SSL front-end, URLs should be HTTPS.
+       if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) {
+               $url = set_url_scheme( $url );
        }
 
        /**
        }
 
        /**