WordPress.org

Make WordPress Core

Ticket #18017: 18017.diff

File 18017.diff, 639 bytes (added by jkudish, 7 years ago)
  • wp-includes/functions.php

     
    36223622}
    36233623
    36243624/**
     3625 * Filter a url to have the correct protocol
     3626 *
     3627 * @since 3.3
     3628 * @param string $url, url to filter
     3629 * @return string $url, filtered url
     3630 */
     3631function set_url_scheme($url) {
     3632        if ( is_ssl() ) {
     3633                $url = str_replace( 'http://', 'https://', $url );
     3634        } else {
     3635                $url = str_replace( 'https://', 'http://', $url );
     3636  }
     3637        return $url;
     3638}
     3639
     3640/**
    36253641 * Whether SSL login should be forced.
    36263642 *
    36273643 * @since 2.6.0