mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Add more robust php unit to detect not escaped sql. Fix not escaped sql
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Classe permettant la gestion des paiements des charges
|
||||
* La tva collectee n'est calculee que sur les factures payees.
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ class ChargeSociales extends CommonObject
|
||||
public $table='chargesociales';
|
||||
public $table_element='chargesociales';
|
||||
public $picto = 'bill';
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -110,7 +110,7 @@ class ChargeSociales extends CommonObject
|
||||
$this->paye = $obj->paye;
|
||||
$this->periode = $this->db->jdate($obj->periode);
|
||||
$this->import_key = $this->import_key;
|
||||
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
return 1;
|
||||
@@ -171,8 +171,8 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, date_creation)";
|
||||
$sql.= " VALUES (".$this->type;
|
||||
$sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL');
|
||||
$sql.= ", ".($this->mode_reglement_id>0?"'".$this->mode_reglement_id."'":"NULL");
|
||||
$sql.= ", ".($this->fk_account>0 ? $this->fk_account:'NULL');
|
||||
$sql.= ", ".($this->mode_reglement_id>0 ? $this->mode_reglement_id:"NULL");
|
||||
$sql.= ", '".$this->db->escape($this->lib)."'";
|
||||
$sql.= ", '".$this->db->idate($this->date_ech)."'";
|
||||
$sql.= ", '".$this->db->idate($this->periode)."'";
|
||||
@@ -378,7 +378,7 @@ class ChargeSociales extends CommonObject
|
||||
if ($return) return 1;
|
||||
else return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le libelle du statut d'une charge (impaye, payee)
|
||||
*
|
||||
@@ -445,7 +445,7 @@ class ChargeSociales extends CommonObject
|
||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||
}
|
||||
|
||||
|
||||
return "Error, mode/status not found";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user