forked from Wavyzz/dolibarr
Add more robust php unit to detect not escaped sql. Fix not escaped sql
This commit is contained in:
@@ -72,7 +72,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@@ -105,7 +105,7 @@ class mod_contract_serpis extends ModelNumRefContracts
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.= " WHERE ref like '".$this->prefix."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$this->db->escape($this->prefix)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
|
||||
Reference in New Issue
Block a user