Merge pull request #38493 from Hystepik/fix-#38461-SQL-Injection

Fix #38461 Sql Injection in PaymentVAT
This commit is contained in:
Alexandre SPANGARO 2026-06-03 06:29:19 +02:00 committed by GitHub
commit 8f140fd1e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -236,7 +236,7 @@ class PaymentVAT extends CommonObject
if ($totalamount != 0) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_vat (fk_tva, datec, datep, amount,";
$sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
$sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
$sql .= " VALUES (".((int) $this->chid).", '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaye)."',";
$sql .= " ".((float) $totalamount).",";
$sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.",";