summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorChristian Schneider2020-01-13 14:50:22 +0100
committerChristian Schneider2020-01-13 14:50:22 +0100
commit2a342bf5f40475ab92bcfa0de5551b16097a9e4e (patch)
tree8af0b5130769b03d750532b8f3a89902347838de /it.class
parentaa0ed8e08c48573ef8be73ac4b2be7f7a95503e7 (diff)
downloaditools-2a342bf5f40475ab92bcfa0de5551b16097a9e4e.tar.gz
itools-2a342bf5f40475ab92bcfa0de5551b16097a9e4e.tar.bz2
itools-2a342bf5f40475ab92bcfa0de5551b16097a9e4e.zip
Add compatibility function to map new setcookie() parameters to pre-7.3 PHP version
Diffstat (limited to 'it.class')
-rw-r--r--it.class10
1 files changed, 10 insertions, 0 deletions
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);
+}
+
}