2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2021-09-27 15:50:19 +02:00
parent d4cc60640b
commit 80165811e0
5 changed files with 36 additions and 38 deletions

View File

@@ -205,8 +205,6 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
'conf.class.php',
'html.form.class.php',
'html.formmail.class.php',
'infobox.class.php',
'link.class.php',
'translate.class.php',
'utils.class.php',
'modules_product.class.php',
@@ -215,8 +213,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
'multicurrency.class.php',
'productbatch.class.php',
'reception.class.php',
'societe.class.php' ,
'account.class.php'
'societe.class.php'
))) {
// Must not found $db->
$ok=true;
@@ -337,7 +334,7 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
// Check string sql|set...'".$yyy->xxx with xxx that is not 'escape', 'idate', .... It means we forget a db->escape when forging sql request.
preg_match_all('/(sql|SET|WHERE|INSERT|VALUES).+\s*\'"\s*\.\s*\$(.........)/', $filecontent, $matches, PREG_SET_ORDER);
foreach ($matches as $key => $val) {
if (! in_array($val[2], array('this->db-', 'this->esc', 'db->escap', 'mydb->esc', 'dbsession', 'db->idate', 'escapedli', 'excludeGr', 'includeGr'))) {
if (! in_array($val[2], array('this->db-', 'this->esc', 'db->escap', 'dbs->esca', 'mydb->esc', 'dbsession', 'db->idate', 'escapedli', 'excludeGr', 'includeGr'))) {
$ok=false;
break;
}