2
0
forked from Wavyzz/dolibarr

More robust test on missing permission for CTI

This commit is contained in:
Laurent Destailleur
2024-09-13 11:13:38 +02:00
parent 75d62b5f0a
commit 4a303a61d1
7 changed files with 44 additions and 12 deletions

View File

@@ -662,7 +662,8 @@ class CodingPhpTest extends CommonClassTest
$filecontentaction = $filecontent;
}
preg_match_all('/if.*\$action\s*==\s*[\'"][a-z\-]+[\'"].*$/', $filecontentaction, $matches, PREG_SET_ORDER);
preg_match_all('/if.*\$action\s*==\s*[\'"][a-z\-]+[\'"].*$/si', $filecontentaction, $matches, PREG_SET_ORDER);
foreach ($matches as $key => $val) {
if (!preg_match('/\$user->hasR/', $val[0])
&& !preg_match('/\$permission/', $val[0])