2
0
forked from Wavyzz/dolibarr

FIX #yogosha8272

This commit is contained in:
Laurent Destailleur
2022-01-08 19:50:55 +01:00
parent c3a42162d9
commit eddc2a1a26
3 changed files with 17 additions and 4 deletions

View File

@@ -473,6 +473,19 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
$this->assertTrue($ok, 'Found a forbidden string sequence into '.$file['relativename'].' : name="token" value="\'.$_SESSION[..., you must use a newToken() instead of $_SESSION[\'newtoken\'].');
// Test we don't have @var array(
$ok=true;
$matches=array();
preg_match_all('/preg_grep\(.*\$/', $filecontent, $matches, PREG_SET_ORDER);
foreach ($matches as $key => $val) {
if (strpos($val[0], 'preg_quote') === false) {
$ok=false;
break;
}
}
$this->assertTrue($ok, 'Found a preg_grep with a param that is a $var but without preg_quote in file '.$file['relativename'].'.');
// Test we don't have @var array(
$ok=true;
$matches=array();