Do secure redirect only for admin destinations. see #7561

git-svn-id: http://svn.automattic.com/wordpress/trunk@8730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-08-25 20:40:34 +00:00
parent 9f27224a27
commit 8dfd6d050f
2 changed files with 3 additions and 3 deletions

View File

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