2
0
forked from Wavyzz/dolibarr

Clean code. Add permission test after action = something.

This commit is contained in:
Laurent Destailleur
2024-09-30 11:38:29 +02:00
parent 61e8382869
commit d7d8f87045
18 changed files with 68 additions and 53 deletions

View File

@@ -662,7 +662,7 @@ class CodingPhpTest extends CommonClassTest
$filecontentaction = $filecontent;
}
preg_match_all('/if.*\$action\s*==\s*[\'"][a-z\-]+[\'"].*$/si', $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])