Force_ssl handling #2442
This commit is contained in:
parent
18ab00d10d
commit
1ccd60d2cf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue