From 2a342bf5f40475ab92bcfa0de5551b16097a9e4e Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 13 Jan 2020 14:50:22 +0100 Subject: Add compatibility function to map new setcookie() parameters to pre-7.3 PHP version --- it.class | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'it.class') diff --git a/it.class b/it.class index 9fcd3ef..442fd66 100644 --- a/it.class +++ b/it.class @@ -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); +} + } -- cgit v1.2.3