2
0
forked from Wavyzz/dolibarr

Enhance the protection on missing permissions

This commit is contained in:
Laurent Destailleur
2024-09-06 15:49:57 +02:00
parent b1b1491299
commit b02a891f2f
4 changed files with 11 additions and 5 deletions

View File

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