Changeset 21664 for trunk/wp-includes/pluggable.php
- Timestamp:
- 08/30/2012 01:33:00 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r21563 r21664 749 749 // If https is required and request is http, redirect 750 750 if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 751 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http') ) {752 wp_redirect( preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));751 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { 752 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); 753 753 exit(); 754 754 } else { 755 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);755 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 756 756 exit(); 757 757 } … … 768 768 // If the user wants ssl but the session is not ssl, redirect. 769 769 if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 770 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http') ) {771 wp_redirect( preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));770 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { 771 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); 772 772 exit(); 773 773 } else { 774 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);774 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 775 775 exit(); 776 776 } … … 783 783 nocache_headers(); 784 784 785 if ( is_ssl() ) 786 $proto = 'https://'; 787 else 788 $proto = 'http://'; 789 790 $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 785 $redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 791 786 792 787 $login_url = wp_login_url($redirect, true);
Note: See TracChangeset
for help on using the changeset viewer.