Force_ssl handling #2442

This commit is contained in:
Mike Jolley 2013-02-14 17:00:26 +00:00
parent 18ab00d10d
commit 1ccd60d2cf
1 changed files with 1 additions and 4 deletions

View File

@ -62,10 +62,7 @@ function woocommerce_template_redirect() {
// Force SSL
elseif ( get_option('woocommerce_force_ssl_checkout') == 'yes' && ! is_ssl() ) {
if ( is_checkout() ) {
wp_safe_redirect( str_replace('http:', 'https:', get_permalink( woocommerce_get_page_id( 'checkout' ) ) ), 301 );
exit;
} elseif ( is_account_page() || apply_filters( 'woocommerce_force_ssl_checkout', false ) ) {
if ( is_checkout() || is_account_page() || apply_filters( 'woocommerce_force_ssl_checkout', false ) ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
wp_safe_redirect( preg_replace( '|^http://|', 'https://', $_SERVER['REQUEST_URI'] ) );
exit;