diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index cce8d21610a..12e29d949c3 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -756,10 +756,10 @@ class DoliDBPgsql extends DoliDB * * @param string $subject string tested * @param string $pattern SQL pattern to match - * @param string $sqlstring whether or not the string being tested is an SQL expression + * @param int $sqlstring whether or not the string being tested is an SQL expression * @return string SQL string */ - public function regexpsql($subject, $pattern, $sqlstring = false) + public function regexpsql($subject, $pattern, $sqlstring = 0) { if ($sqlstring) { return "(". $subject ." ~ '" . $pattern . "')"; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index a64165b6952..3c5e697f91e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1274,7 +1274,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ // To ensure that all variables within the MAX() brackets are integers // This avoid bad detection of max when data are noised with non numeric values at the position of the numero if (getDolGlobalInt('MAIN_NUMBERING_FILTER_ON_INT_ONLY')) { - $sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', true); + $sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', 1); } if ($bentityon) { // only if entity enable