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/functions.php

    r21541 r21664  
    25862586function url_is_accessable_via_ssl($url)
    25872587{
    2588     if (in_array('curl', get_loaded_extensions())) {
    2589         $ssl = preg_replace( '/^http:\/\//', 'https://',  $url );
     2588    if ( in_array( 'curl', get_loaded_extensions() ) ) {
     2589        $ssl = set_url_scheme( $url, 'https' );
    25902590
    25912591        $ch = curl_init();
     
    29342934 */
    29352935function wp_guess_url() {
    2936     if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
     2936    if ( defined('WP_SITEURL') && '' != WP_SITEURL )
    29372937        $url = WP_SITEURL;
    2938     } else {
    2939         $schema = is_ssl() ? 'https://' : 'http://';
    2940         $url = preg_replace('#/(wp-admin/.*|wp-login.php)#i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    2941     }
     2938    else
     2939        $url = set_url_scheme( preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
     2940
    29422941    return rtrim($url, '/');
    29432942}
Note: See TracChangeset for help on using the changeset viewer.