diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f24e721c5da..9d40a34be45 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13474,7 +13474,7 @@ function dolForgeCriteriaCallback($matches) if (empty($matches[1])) { return ''; } - $tmp = explode(':', $matches[1]); + $tmp = explode(':', $matches[1], 3); if (count($tmp) < 3) { return ''; } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 07c5f1e88f1..624f711389e 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -239,7 +239,7 @@ class FunctionsLibTest extends CommonClassTest // A real search string $filter = "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.date_creation:<:'2016-01-01 12:30:00') or (t.nature:is:NULL)"; $sql = forgeSQLFromUniversalSearchCriteria($filter); - $this->assertEquals(" AND ((t.ref LIKE 'SO-%') or (t.date_creation < '20160101') or (t.date_creation < 0) or (t.nature IS NULL))", $sql); + $this->assertEquals(" AND ((t.ref LIKE 'SO-%') or (t.date_creation < '20160101') or (t.date_creation < '2016-01-01 12:30:00') or (t.nature IS NULL))", $sql); // A real search string $filter = "(t.fieldstring:=:'aaa ttt')";