2
0
forked from Wavyzz/dolibarr

Clean code and prepare a more powerfull phpunit check for sql forging.

This commit is contained in:
Laurent Destailleur
2024-03-05 00:15:33 +01:00
parent 04670b92b3
commit ce010a54c7
54 changed files with 504 additions and 764 deletions

View File

@@ -12697,6 +12697,9 @@ function jsonOrUnserialize($stringtodecode)
*/
function forgeSQLFromUniversalSearchCriteria($filter, &$errorstr = '', $noand = 0, $nopar = 0, $noerror = 0)
{
if ($filter === '') {
return '';
}
if (!preg_match('/^\(.*\)$/', $filter)) { // If $filter does not start and end with ()
$filter = '(' . $filter . ')';
}