From 1ccd60d2cfe02d95a48b3024dbb13d76cd573f21 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 14 Feb 2013 17:00:26 +0000 Subject: [PATCH] Force_ssl handling #2442 --- woocommerce-functions.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/woocommerce-functions.php b/woocommerce-functions.php index ee95186c0bd..7a19a2e1bc1 100644 --- a/woocommerce-functions.php +++ b/woocommerce-functions.php @@ -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;