Make WordPress Core

Ticket #35691: 35691.patch

File 35691.patch, 5.7 KB (added by sebastian.pisula, 9 years ago)
  • wp-includes/ms-settings.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    148148        // No site has been found, bail.
    149149        if ( empty( $current_blog ) ) {
    150150                // We're going to redirect to the network URL, with some possible modifications.
    151                 $scheme = is_ssl() ? 'https' : 'http';
    152                 $destination = "$scheme://{$current_site->domain}{$current_site->path}";
     151                $destination = wp_get_protocol() . $current_site->domain . $current_site->path;
    153152
    154153                /**
    155154                 * Fires when a network can be determined but a site cannot.
  • wp-includes/canonical.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    6161
    6262        if ( ! $requested_url && isset( $_SERVER['HTTP_HOST'] ) ) {
    6363                // build the URL in the address bar
    64                 $requested_url  = is_ssl() ? 'https://' : 'http://';
     64                $requested_url  = wp_get_protocol();
    6565                $requested_url .= $_SERVER['HTTP_HOST'];
    6666                $requested_url .= $_SERVER['REQUEST_URI'];
    6767        }
  • wp-includes/general-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    406406        $defaults = array(
    407407                'echo' => true,
    408408                // Default 'redirect' value takes the user back to the request URI.
    409                 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
     409                'redirect' => wp_get_protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
    410410                'form_id' => 'loginform',
    411411                'label_username' => __( 'Username' ),
    412412                'label_password' => __( 'Password' ),
  • wp-includes/admin-bar.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    351351                return;
    352352        }
    353353
    354         $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     354        $current_url = wp_get_protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    355355        $customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() );
    356356
    357357        $wp_admin_bar->add_menu( array(
  • wp-includes/link-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    33863386        $orig_scheme = $scheme;
    33873387
    33883388        if ( ! $scheme ) {
    3389                 $scheme = is_ssl() ? 'https' : 'http';
     3389                $scheme = wp_get_protocol( false );
    33903390        } elseif ( $scheme === 'admin' || $scheme === 'login' || $scheme === 'login_post' || $scheme === 'rpc' ) {
    33913391                $scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http';
    33923392        } elseif ( $scheme !== 'http' && $scheme !== 'https' && $scheme !== 'relative' ) {
    3393                 $scheme = is_ssl() ? 'https' : 'http';
     3393                $scheme = wp_get_protocol( false );
    33943394        }
    33953395
    33963396        $url = trim( $url );
  • wp-includes/class-wp-admin-bar.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    2424        public function __get( $name ) {
    2525                switch ( $name ) {
    2626                        case 'proto' :
    27                                 return is_ssl() ? 'https://' : 'http://';
     27                                return wp_get_protocol();
    2828
    2929                        case 'menu' :
    3030                                _deprecated_argument( 'WP_Admin_Bar', '3.3', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the <code>menu</code> property.' );
  • wp-includes/functions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    39653965}
    39663966
    39673967/**
     3968 * Return protocol
     3969 *
     3970 * @since 4.5.0
     3971 *
     3972 * @param bool $slashes Add `://` after protocol. Default true.
     3973 *
     3974 * @return string
     3975 */
     3976function wp_get_protocol( $slashes = true ) {
     3977        return ( is_ssl() ? 'https' : 'http' ) . ( $slashes ? '://' : '' );
     3978}
     3979
     3980/**
    39683981 * Whether to force SSL used for the Administration Screens.
    39693982 *
    39703983 * @since 2.6.0
     
    40284041                        }
    40294042                }
    40304043
    4031                 $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet
    4032                 $url = $schema . $_SERVER['HTTP_HOST'] . $path;
     4044                $url = wp_get_protocol() . $_SERVER['HTTP_HOST'] . $path;
    40334045        }
    40344046
    40354047        return rtrim($url, '/');
     
    49524964 */
    49534965function wp_auth_check_html() {
    49544966        $login_url = wp_login_url();
    4955         $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'];
     4967        $current_domain = wp_get_protocol() . $_SERVER['HTTP_HOST'];
    49564968        $same_domain = ( strpos( $login_url, $current_domain ) === 0 );
    49574969
    49584970        /**