mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Option to force SSL. see #7561
git-svn-id: https://develop.svn.wordpress.org/trunk@8701 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -703,8 +703,20 @@ function auth_redirect() {
|
||||
}
|
||||
}
|
||||
|
||||
if ( wp_validate_auth_cookie() )
|
||||
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 ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
|
||||
wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
|
||||
exit();
|
||||
} else {
|
||||
wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
return; // The cookie is good so we're done
|
||||
}
|
||||
|
||||
// The cookie is no good so force login
|
||||
nocache_headers();
|
||||
|
||||
Reference in New Issue
Block a user