From 056614f0f59f5ee5d633b0e4e48fe5edec6dd3cb Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 11 Jan 2023 14:44:52 +0100 Subject: Normalize double sign --/+-/-+/++ calculations in it::date for PHP 8.2 and add tests for it --- it.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it.class') 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); -- cgit v1.2.3