WordPress.org

Make WordPress Core

Ticket #7141: 7141.diff

File 7141.diff, 589 bytes (added by Denis-de-Bernardy, 5 years ago)
  • wp-includes/pluggable.php

     
    726726 
    727727        // If https is required and request is http, redirect 
    728728        if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 
    729                 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 
     729                if ( preg_match('#^https?://#i', $_SERVER['REQUEST_URI']) ) { 
    730730                        wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 
    731731                        exit(); 
    732732                } else {