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

git-svn-id: https://develop.svn.wordpress.org/trunk@42892 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2018-04-03 14:31:16 +00:00
parent 0db556da6c
commit 7a62871459
1 changed files with 2 additions and 2 deletions

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();
} }
} }