diff options
author | Christian Schneider | 2020-01-13 14:50:22 +0100 |
---|---|---|
committer | Christian Schneider | 2020-01-13 14:50:22 +0100 |
commit | 2a342bf5f40475ab92bcfa0de5551b16097a9e4e (patch) | |
tree | 8af0b5130769b03d750532b8f3a89902347838de | |
parent | aa0ed8e08c48573ef8be73ac4b2be7f7a95503e7 (diff) | |
download | itools-2a342bf5f40475ab92bcfa0de5551b16097a9e4e.tar.gz itools-2a342bf5f40475ab92bcfa0de5551b16097a9e4e.tar.bz2 itools-2a342bf5f40475ab92bcfa0de5551b16097a9e4e.zip |
Add compatibility function to map new setcookie() parameters to pre-7.3 PHP version
-rw-r--r-- | it.class | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1261,4 +1261,14 @@ static function params2utf8() unset($_REQUEST[$key], $_GET[$key]); } +/** + * Compatibility function to map new setcookie() parameters to pre-7.3 PHP version + */ +static function setcookie($name, $value, $p = []) +{ + return version_compare(PHP_VERSION, '7.3.0', '<') + ? @setcookie($name, $value, $p['expires'], $p['path'], $p['domain'], $p['secure'], $p['httponly']) + : @setcookie($name, $value, $p); +} + } |