Fix: problème avec les apostrophes

This commit is contained in:
Regis Houssin 2007-07-23 20:24:33 +00:00
parent d45a056645
commit 58f564ce6f
2 changed files with 22 additions and 22 deletions

View File

@ -125,13 +125,13 @@ class Entrepot
*/ */
function update($id, $user) function update($id, $user)
{ {
$this->libelle=trim($this->libelle); $this->libelle=addslashes(trim($this->libelle));
$this->description=trim($this->description); $this->description=addslashes(trim($this->description));
$this->lieu=trim($this->lieu); $this->lieu=addslashes(trim($this->lieu));
$this->address=trim($this->address); $this->address=addslashes(trim($this->address));
$this->cp=trim($this->cp); $this->cp=trim($this->cp);
$this->ville=trim($this->ville); $this->ville=addslashes(trim($this->ville));
$this->pays_id=trim($this->pays_id?$this->pays_id:0); $this->pays_id=trim($this->pays_id?$this->pays_id:0);
$sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot ";

View File

@ -53,15 +53,15 @@ if ($_POST["action"] == 'add')
{ {
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
$entrepot->ref = trim($_POST["ref"]); $entrepot->ref = $_POST["ref"];
$entrepot->libelle = trim($_POST["libelle"]); $entrepot->libelle = $_POST["libelle"];
$entrepot->description = trim($_POST["desc"]); $entrepot->description = $_POST["desc"];
$entrepot->statut = trim($_POST["statut"]); $entrepot->statut = $_POST["statut"];
$entrepot->lieu = trim($_POST["lieu"]); $entrepot->lieu = $_POST["lieu"];
$entrepot->address = trim($_POST["address"]); $entrepot->address = $_POST["address"];
$entrepot->cp = trim($_POST["cp"]); $entrepot->cp = $_POST["cp"];
$entrepot->ville = trim($_POST["ville"]); $entrepot->ville = $_POST["ville"];
$entrepot->pays_id = trim($_POST["pays_id"]); $entrepot->pays_id = $_POST["pays_id"];
if ($entrepot->libelle) { if ($entrepot->libelle) {
$id = $entrepot->create($user); $id = $entrepot->create($user);
@ -84,14 +84,14 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
$entrepot = new Entrepot($db); $entrepot = new Entrepot($db);
if ($entrepot->fetch($_POST["id"])) if ($entrepot->fetch($_POST["id"]))
{ {
$entrepot->libelle = trim($_POST["libelle"]); $entrepot->libelle = $_POST["libelle"];
$entrepot->description = trim($_POST["desc"]); $entrepot->description = $_POST["desc"];
$entrepot->statut = trim($_POST["statut"]); $entrepot->statut = $_POST["statut"];
$entrepot->lieu = trim($_POST["lieu"]); $entrepot->lieu = $_POST["lieu"];
$entrepot->address = trim($_POST["address"]); $entrepot->address = $_POST["address"];
$entrepot->cp = trim($_POST["cp"]); $entrepot->cp = $_POST["cp"];
$entrepot->ville = trim($_POST["ville"]); $entrepot->ville = $_POST["ville"];
$entrepot->pays_id = trim($_POST["pays_id"]); $entrepot->pays_id = $_POST["pays_id"];
if ( $entrepot->update($_POST["id"], $user) > 0) if ( $entrepot->update($_POST["id"], $user) > 0)
{ {