Do secure redirect only for admin destinations. see #7561
git-svn-id: https://develop.svn.wordpress.org/trunk@8730 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b5f62016f5
commit
00e2cd0917
@ -693,7 +693,7 @@ function auth_redirect() {
|
||||
$secure = false;
|
||||
|
||||
// If https is required and request is http, redirect
|
||||
if ( $secure && !is_ssl() ) {
|
||||
if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
|
||||
if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
|
||||
wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
|
||||
exit();
|
||||
@ -705,7 +705,7 @@ function auth_redirect() {
|
||||
|
||||
if ( $user_id = wp_validate_auth_cookie() ) {
|
||||
// If the user wants ssl but the session is not ssl, redirect.
|
||||
if ( !$secure && get_user_option('use_ssl', $user_id) ) {
|
||||
if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
|
||||
if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
|
||||
wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
|
||||
exit();
|
||||
|
@ -423,7 +423,7 @@ default:
|
||||
if ( isset( $_REQUEST['redirect_to'] ) ) {
|
||||
$redirect_to = $_REQUEST['redirect_to'];
|
||||
// Redirect to https if user wants ssl
|
||||
if ( $secure_cookie )
|
||||
if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
|
||||
$redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
|
||||
} else {
|
||||
$redirect_to = admin_url();
|
||||
|
Loading…
Reference in New Issue
Block a user