Plugin Directory

Changeset 2420356


Ignore:
Timestamp:
11/17/2020 09:33:27 PM (5 years ago)
Author:
Mosterd3d
Message:

tagging version 6.2.1

Location:
dd-lastviewed
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dd-lastviewed/tags/6.2.1/last-viewed.php

    r2419639 r2420356  
    22/*
    33Plugin Name: DD Last Viewed
    4 Version: 6.2
     4Version: 6.2.1
    55Plugin URI: http://wouterdijkstra.com
    66Description: Shows the users recently viewed/visited posts, filtered on types or terms, in a widget.
     
    153153            $secure = isset($cookie['secure']) && $cookie['secure'] === '1';
    154154
    155             $cookieOptions2 = array(
     155            $cookieOptions = array(
    156156                'expires' => $cookie['expire'],
    157157                'path' => $cookie['path']
     
    159159
    160160            if ($this->isHttps() && !$cookie['advanced_checked']) {
    161                 $cookieOptions2['samesite'] =  $this->cookieSameSite_default;
     161                $cookieOptions['samesite'] =  $this->cookieSameSite_default;
    162162            }
    163163
    164164            if ($cookie['advanced_checked']) {
    165                 $cookieOptions2['expires'] = $cookie['expire'];
    166                 $cookieOptions2['path'] = $cookie['path'];
    167                 $cookieOptions2['samesite'] = $sameSite;
    168                 $cookieOptions2['secure'] = $secure;
     165                $cookieOptions['expires'] = $cookie['expire'];
     166                $cookieOptions['path'] = $cookie['path'];
     167                $cookieOptions['samesite'] = $sameSite;
     168                $cookieOptions['secure'] = $secure;
    169169            }
    170             setcookie( $cookie['name'], $cookie['list'], $cookieOptions2 );
     170           
     171            if (version_compare(PHP_VERSION, '7.3') >= 0) {
     172                // php version > 7.3
     173                setcookie( $cookie['name'], $cookie['list'], $cookieOptions );
     174            } else {
     175                // php version < 7.3
     176                if($secure) {
     177                    setcookie($cookie['name'], $cookie['list'], $cookie['expire'], $cookie['path'], "", 1);
     178                } else {
     179                    setcookie($cookie['name'], $cookie['list'], $cookie['expire'], $cookie['path']);
     180                }
     181            }
    171182        }
    172183    }
  • dd-lastviewed/tags/6.2.1/readme.txt

    r2419639 r2420356  
    55Requires at least: 3.3
    66Tested up to: 5.5.3
    7 Stable tag: 6.2
     7Stable tag: 6.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5656== Changelog ==
    5757
     58= 6.2.1 =
     59* Fix setCookie for diff php versions > or < 7.3 (options array)
     60
    5861= 6.2 =
    5962* pre-fill post types with 'post and pages' if emtpy
  • dd-lastviewed/trunk/last-viewed.php

    r2419639 r2420356  
    22/*
    33Plugin Name: DD Last Viewed
    4 Version: 6.2
     4Version: 6.2.1
    55Plugin URI: http://wouterdijkstra.com
    66Description: Shows the users recently viewed/visited posts, filtered on types or terms, in a widget.
     
    153153            $secure = isset($cookie['secure']) && $cookie['secure'] === '1';
    154154
    155             $cookieOptions2 = array(
     155            $cookieOptions = array(
    156156                'expires' => $cookie['expire'],
    157157                'path' => $cookie['path']
     
    159159
    160160            if ($this->isHttps() && !$cookie['advanced_checked']) {
    161                 $cookieOptions2['samesite'] =  $this->cookieSameSite_default;
     161                $cookieOptions['samesite'] =  $this->cookieSameSite_default;
    162162            }
    163163
    164164            if ($cookie['advanced_checked']) {
    165                 $cookieOptions2['expires'] = $cookie['expire'];
    166                 $cookieOptions2['path'] = $cookie['path'];
    167                 $cookieOptions2['samesite'] = $sameSite;
    168                 $cookieOptions2['secure'] = $secure;
     165                $cookieOptions['expires'] = $cookie['expire'];
     166                $cookieOptions['path'] = $cookie['path'];
     167                $cookieOptions['samesite'] = $sameSite;
     168                $cookieOptions['secure'] = $secure;
    169169            }
    170             setcookie( $cookie['name'], $cookie['list'], $cookieOptions2 );
     170           
     171            if (version_compare(PHP_VERSION, '7.3') >= 0) {
     172                // php version > 7.3
     173                setcookie( $cookie['name'], $cookie['list'], $cookieOptions );
     174            } else {
     175                // php version < 7.3
     176                if($secure) {
     177                    setcookie($cookie['name'], $cookie['list'], $cookie['expire'], $cookie['path'], "", 1);
     178                } else {
     179                    setcookie($cookie['name'], $cookie['list'], $cookie['expire'], $cookie['path']);
     180                }
     181            }
    171182        }
    172183    }
  • dd-lastviewed/trunk/readme.txt

    r2419639 r2420356  
    55Requires at least: 3.3
    66Tested up to: 5.5.3
    7 Stable tag: 6.2
     7Stable tag: 6.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5656== Changelog ==
    5757
     58= 6.2.1 =
     59* Fix setCookie for diff php versions > or < 7.3 (options array)
     60
    5861= 6.2 =
    5962* pre-fill post types with 'post and pages' if emtpy
Note: See TracChangeset for help on using the changeset viewer.