Login: Use wp_safe_redirect() when redirecting the login page if forced to use HTTPS.

Merge of [42892] to the 4.3 branch.

Built from https://develop.svn.wordpress.org/branches/4.3@42901


git-svn-id: http://core.svn.wordpress.org/branches/4.3@42731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2018-04-03 15:32:08 +00:00
parent 89fe744a7d
commit 11ab85e805

View File

@ -14,10 +14,10 @@ require( dirname(__FILE__) . '/wp-load.php' );
// Redirect to https login if forced to use SSL // Redirect to https login if forced to use SSL
if ( force_ssl_admin() && ! is_ssl() ) { if ( force_ssl_admin() && ! is_ssl() ) {
if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit(); exit();
} else { } else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit(); exit();
} }
} }