Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions 14 multi-device-switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 ] ) ) {
Expand Down Expand Up @@ -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'] );

Expand Down Expand Up @@ -1125,4 +1125,4 @@ function is_disable_switcher() {
}
endif;

?>
?>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.