WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/30/2012 01:33:00 PM (9 years ago)
Author:
ryan
Message:

Use set_url_scheme(). Props johnbillion, MarcusPope. see #19037 #20759

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r21628 r21664  
    18761876
    18771877/**
    1878  * Formats an String URL to use HTTPS if HTTP is found.
     1878 * Formats a URL to use https.
     1879 *
    18791880 * Useful as a filter.
    18801881 *
    18811882 * @since 2.8.5
    1882  **/
     1883 *
     1884 * @param string URL
     1885 * @return string URL with https as the scheme
     1886 */
    18831887function filter_SSL( $url ) {
    1884     if ( !is_string( $url ) )
    1885         return get_bloginfo( 'url' ); //return home blog url with proper scheme
    1886 
    1887     $arrURL = parse_url( $url );
    1888 
    1889     if ( force_ssl_content() && is_ssl() ) {
    1890         if ( 'http' === $arrURL['scheme'] )
    1891             $url = str_replace( $arrURL['scheme'], 'https', $url );
    1892     }
     1888    if ( ! is_string( $url ) )
     1889        return get_bloginfo( 'url' ); // Return home blog url with proper scheme
     1890
     1891    if ( force_ssl_content() && is_ssl() )
     1892        $url = set_url_scheme( $url, 'https' );
    18931893
    18941894    return $url;
Note: See TracChangeset for help on using the changeset viewer.