summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorChristian Schneider2023-01-11 14:44:52 +0100
committerChristian Schneider2023-01-11 14:44:52 +0100
commit056614f0f59f5ee5d633b0e4e48fe5edec6dd3cb (patch)
tree1fffcd99a1d9076648e207f919ad55a7ea91d7e0 /it.class
parent78e3077d55fd6c7322f6c542dda328c0a19b7693 (diff)
downloaditools-056614f0f59f5ee5d633b0e4e48fe5edec6dd3cb.tar.gz
itools-056614f0f59f5ee5d633b0e4e48fe5edec6dd3cb.tar.bz2
itools-056614f0f59f5ee5d633b0e4e48fe5edec6dd3cb.zip
Normalize double sign --/+-/-+/++ calculations in it::date for PHP 8.2 and add tests for it
Diffstat (limited to 'it.class')
-rw-r--r--it.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it.class b/it.class
index 8375b83..f302bce 100644
--- a/it.class
+++ b/it.class
@@ -1044,7 +1044,7 @@ static function date($format = "", $stamp = null)
if (!isset($stamp))
$stamp = it::time();
else if (is_string($stamp) && !ctype_digit($stamp))
- $stamp = strtotime($stamp, it::time());
+ $stamp = strtotime(it::replace(['\s(--|\+\+)\s*(\d)' => ' +\2', '\s(\+-|-\+)\s*(\d)' => ' -\2'], $stamp), it::time());
list($name, $language) = explode(":", $format);