From 8f65be0445a91a2c2510af2b16488a5c38c5d113 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 20 Nov 2016 14:49:59 +0000 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=83=E5=BC=95=E6=95=B0=E3=82=92fa?= =?UTF-8?q?lse=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- multi-device-switcher.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/multi-device-switcher.php b/multi-device-switcher.php index 6490638..d409d2f 100644 --- a/multi-device-switcher.php +++ b/multi-device-switcher.php @@ -66,12 +66,12 @@ public function __construct() { public function switch_theme() { if ( isset( $_COOKIE[ $this->cookie_name_disable_switcher ] ) ) { - setcookie( $this->cookie_name_disable_switcher, null, time() - 3600, '/' ); + setcookie( $this->cookie_name_disable_switcher, null, time() - 3600, '/', '', is_ssl(), false ); } if ( $this->is_disable_switcher() ) { - setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/' ); - setcookie( $this->cookie_name_disable_switcher, 1, null, '/' ); + setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/', '', is_ssl(), false ); + setcookie( $this->cookie_name_disable_switcher, 1, null, '/', '', is_ssl(), false ); return; } @@ -112,10 +112,10 @@ public function switch_theme() { add_filter( 'template', array( $this, 'get_template' ) ); add_action( 'wp_footer', array( $this, 'add_pc_switcher' ) ); - setcookie( $this->cookie_name_multi_device_switcher, preg_replace( '/^custom_switcher_/', '', $this->device ), null, '/' ); + setcookie( $this->cookie_name_multi_device_switcher, preg_replace( '/^custom_switcher_/', '', $this->device ), null, '/', '', is_ssl(), false ); } else { - setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/' ); + setcookie( $this->cookie_name_multi_device_switcher, null, time() - 3600, '/', '', is_ssl(), false ); } if ( isset( $_COOKIE[ $this->cookie_name_pc_switcher ] ) ) { @@ -230,7 +230,7 @@ public function get_device_theme() { public function session() { if ( isset( $_GET['pc-switcher'] ) ) { - setcookie( $this->cookie_name_pc_switcher, $_GET['pc-switcher'] ? 1 : '', null, '/' ); + setcookie( $this->cookie_name_pc_switcher, $_GET['pc-switcher'] ? 1 : '', null, '/', '', is_ssl(), false ); $uri = preg_replace( '/^(.+?)(\?.*)$/', '$1', $_SERVER['REQUEST_URI'] ); @@ -1125,4 +1125,4 @@ function is_disable_switcher() { } endif; -?> \ No newline at end of file +?>