Changeset 2419101
- Timestamp:
- 11/15/2020 10:41:51 PM (5 years ago)
- Location:
- dd-lastviewed
- Files:
-
- 4 added
- 6 edited
- 1 copied
-
tags/6.1 (copied) (copied from dd-lastviewed/trunk)
-
tags/6.1/css/admin-style.css.map (added)
-
tags/6.1/css/style.css.map (added)
-
tags/6.1/dd_templates/form.php (modified) (1 diff)
-
tags/6.1/last-viewed.php (modified) (6 diffs)
-
tags/6.1/readme.txt (modified) (2 diffs)
-
trunk/css/admin-style.css.map (added)
-
trunk/css/style.css.map (added)
-
trunk/dd_templates/form.php (modified) (1 diff)
-
trunk/last-viewed.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dd-lastviewed/tags/6.1/dd_templates/form.php
r2397279 r2419101 318 318 <?php 319 319 320 $secureOptions = array('True' => true, 'False' => false);320 $secureOptions = array('True' => '1', 'False' => '0'); 321 321 322 322 ?> -
dd-lastviewed/tags/6.1/last-viewed.php
r2397279 r2419101 2 2 /* 3 3 Plugin Name: DD Last Viewed 4 Version: 6. 04 Version: 6.1 5 5 Plugin URI: http://wouterdijkstra.com 6 6 Description: Shows the users recently viewed/visited posts, filtered on types or terms, in a widget. … … 56 56 private $cookieFormat = 'days'; 57 57 private $cookieSameSite_default = 'Lax'; 58 private $cookieSecure_default = false;58 private $cookieSecure_default = '0'; 59 59 private $post_type; 60 60 private $selectedTypesTerms; … … 150 150 $cookieListPhp = ($this->generateCookiesDataObject('php')); 151 151 foreach ($cookieListPhp as $cookie) { 152 $sameSite = $cookie['sameSite'] ? $cookie['sameSite'] : $this->cookieSameSite_default; 153 $secure = $cookie['secure'] === 'True'; 152 $sameSite = isset($cookie['sameSite']) ? $cookie['sameSite'] : $this->cookieSameSite_default; 153 $secure = isset($cookie['secure']) && $cookie['secure'] === '1'; 154 155 $cookieOptions2 = array( 156 'expires' => $cookie['expire'], 157 'path' => $cookie['path'] 158 ); 159 160 if ($this->isHttps() && !$cookie['advanced_checked']) { 161 $cookieOptions2['samesite'] = $this->cookieSameSite_default; 162 } 154 163 155 164 if ($cookie['advanced_checked']) { 156 $cookieOptions = array( 157 'expires' => $cookie['expire'], 158 'path' => $cookie['path'], 159 'samesite' => $sameSite, 160 'secure' => $secure 161 ); 162 } else { 163 $cookieOptions = array( 164 'expires' => $cookie['expire'], 165 'path' => $cookie['path'], 166 ); 165 $cookieOptions2['expires'] = $cookie['expire']; 166 $cookieOptions2['path'] = $cookie['path']; 167 $cookieOptions2['samesite'] = $sameSite; 168 $cookieOptions2['secure'] = $secure; 167 169 } 168 169 setcookie( $cookie['name'], $cookie['list'], $cookieOptions ); 170 setcookie( $cookie['name'], $cookie['list'], $cookieOptions2 ); 170 171 } 171 172 } … … 393 394 $instance['cookie_timeformat'] = strip_tags($new_instance['cookie_timeformat']); 394 395 $instance['cookie_samesite'] = strip_tags($new_instance['cookie_samesite']); 395 $instance['cookie_secure'] = (bool)$new_instance['cookie_secure'];396 $instance['cookie_secure'] = strip_tags($new_instance['cookie_secure']); 396 397 } else { 397 398 $instance['cookie_lifetime'] = $this->cookieLifetime; … … 411 412 } 412 413 return $instance; 414 } 415 416 function isHttps() { 417 return 418 (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') 419 || $_SERVER['SERVER_PORT'] == 443; 413 420 } 414 421 … … 521 528 $this->post_content_settings = $post_content_settings; 522 529 $this->settings_are_set = isset($thisWidget['selection']) && ($post_title_settings['is_active'] || $post_thumb_settings['is_active'] || $post_content_settings['is_active']); 523 $this->post_list = new WP_Query($list_args);530 $this->post_list = !empty($idList) ? new WP_Query($list_args) : new WP_Query(); 524 531 } 525 532 -
dd-lastviewed/tags/6.1/readme.txt
r2397279 r2419101 4 4 Tags: history, lastviewed, recently, visited, posts viewed recently, customisable, seo, woo-commerce, posts, custom, posttypes, thumbnail, cookie, widget, recent, visit terms, taxonomies, taxonomy, term, category, template, customise, woocommerce 5 5 Requires at least: 3.3 6 Tested up to: 5.5. 17 Stable tag: 6. 06 Tested up to: 5.5.3 7 Stable tag: 6.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 == Changelog == 57 57 58 = 6.1 = 59 * Fix cookie secure option 60 * Fix missing style.css.map 61 * Set 'lax'(samesite) by default if https 62 * Fix bug visiting same page as the only one set in the cookie 63 58 64 = 6.0 = 59 65 * Created advanced cookie settings -
dd-lastviewed/trunk/dd_templates/form.php
r2397279 r2419101 318 318 <?php 319 319 320 $secureOptions = array('True' => true, 'False' => false);320 $secureOptions = array('True' => '1', 'False' => '0'); 321 321 322 322 ?> -
dd-lastviewed/trunk/last-viewed.php
r2397279 r2419101 2 2 /* 3 3 Plugin Name: DD Last Viewed 4 Version: 6. 04 Version: 6.1 5 5 Plugin URI: http://wouterdijkstra.com 6 6 Description: Shows the users recently viewed/visited posts, filtered on types or terms, in a widget. … … 56 56 private $cookieFormat = 'days'; 57 57 private $cookieSameSite_default = 'Lax'; 58 private $cookieSecure_default = false;58 private $cookieSecure_default = '0'; 59 59 private $post_type; 60 60 private $selectedTypesTerms; … … 150 150 $cookieListPhp = ($this->generateCookiesDataObject('php')); 151 151 foreach ($cookieListPhp as $cookie) { 152 $sameSite = $cookie['sameSite'] ? $cookie['sameSite'] : $this->cookieSameSite_default; 153 $secure = $cookie['secure'] === 'True'; 152 $sameSite = isset($cookie['sameSite']) ? $cookie['sameSite'] : $this->cookieSameSite_default; 153 $secure = isset($cookie['secure']) && $cookie['secure'] === '1'; 154 155 $cookieOptions2 = array( 156 'expires' => $cookie['expire'], 157 'path' => $cookie['path'] 158 ); 159 160 if ($this->isHttps() && !$cookie['advanced_checked']) { 161 $cookieOptions2['samesite'] = $this->cookieSameSite_default; 162 } 154 163 155 164 if ($cookie['advanced_checked']) { 156 $cookieOptions = array( 157 'expires' => $cookie['expire'], 158 'path' => $cookie['path'], 159 'samesite' => $sameSite, 160 'secure' => $secure 161 ); 162 } else { 163 $cookieOptions = array( 164 'expires' => $cookie['expire'], 165 'path' => $cookie['path'], 166 ); 165 $cookieOptions2['expires'] = $cookie['expire']; 166 $cookieOptions2['path'] = $cookie['path']; 167 $cookieOptions2['samesite'] = $sameSite; 168 $cookieOptions2['secure'] = $secure; 167 169 } 168 169 setcookie( $cookie['name'], $cookie['list'], $cookieOptions ); 170 setcookie( $cookie['name'], $cookie['list'], $cookieOptions2 ); 170 171 } 171 172 } … … 393 394 $instance['cookie_timeformat'] = strip_tags($new_instance['cookie_timeformat']); 394 395 $instance['cookie_samesite'] = strip_tags($new_instance['cookie_samesite']); 395 $instance['cookie_secure'] = (bool)$new_instance['cookie_secure'];396 $instance['cookie_secure'] = strip_tags($new_instance['cookie_secure']); 396 397 } else { 397 398 $instance['cookie_lifetime'] = $this->cookieLifetime; … … 411 412 } 412 413 return $instance; 414 } 415 416 function isHttps() { 417 return 418 (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') 419 || $_SERVER['SERVER_PORT'] == 443; 413 420 } 414 421 … … 521 528 $this->post_content_settings = $post_content_settings; 522 529 $this->settings_are_set = isset($thisWidget['selection']) && ($post_title_settings['is_active'] || $post_thumb_settings['is_active'] || $post_content_settings['is_active']); 523 $this->post_list = new WP_Query($list_args);530 $this->post_list = !empty($idList) ? new WP_Query($list_args) : new WP_Query(); 524 531 } 525 532 -
dd-lastviewed/trunk/readme.txt
r2397279 r2419101 4 4 Tags: history, lastviewed, recently, visited, posts viewed recently, customisable, seo, woo-commerce, posts, custom, posttypes, thumbnail, cookie, widget, recent, visit terms, taxonomies, taxonomy, term, category, template, customise, woocommerce 5 5 Requires at least: 3.3 6 Tested up to: 5.5. 17 Stable tag: 6. 06 Tested up to: 5.5.3 7 Stable tag: 6.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 == Changelog == 57 57 58 = 6.1 = 59 * Fix cookie secure option 60 * Fix missing style.css.map 61 * Set 'lax'(samesite) by default if https 62 * Fix bug visiting same page as the only one set in the cookie 63 58 64 = 6.0 = 59 65 * Created advanced cookie settings
Note: See TracChangeset
for help on using the changeset viewer.