diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index ab089ffdeed..28272a38a2b 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -38,10 +38,10 @@ $html = new Form($db); if ($_POST["action"] == 'update' && $user->rights->categorie->creer) { - $categorie->label = stripslashes($_POST["nom"]); - $categorie->description = stripslashes($_POST["description"]); + $categorie->label = $_POST["nom"]; + $categorie->description = $_POST["description"]; if($_POST['catMere'] != "-1") - $categorie->id_mere = stripslashes($_POST['catMere']); + $categorie->id_mere = $_POST['catMere']; if (!$categorie->label || !$categorie->description) @@ -72,9 +72,9 @@ print ''; trans("Label"); ?> : - trans("Description"); ?> : diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 47b1f376caa..14b1d415d6b 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -51,16 +51,16 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) { $categorie = new Categorie($db); - $categorie->label = stripslashes($_POST["nom"]); - $categorie->description = stripslashes($_POST["description"]); + $categorie->label = $_POST["nom"]; + $categorie->description = $_POST["description"]; if($_POST['catMere'] != "-1") - $categorie->id_mere = stripslashes($_POST['catMere']); + $categorie->id_mere = $_POST['catMere']; if (!$categorie->label || !$categorie->description) { $_GET["action"] = 'create'; - $categorie->error = "Le libellé ou la description n'a pas été renseigné"; + $categorie->error = $langs->trans(ErrForgotField); } if ($categorie->error =="") { @@ -68,6 +68,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) { $_GET["action"] = 'confirmed'; $_POST["addcat"] = ''; + } } /* @@ -80,19 +81,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) print ''; print '
'; - - if ($_error == 3) - { - print '

'.$langs->trans("ImpossibleAddCat").' '.$categorie->label.'

'; - } - else - { - print '

'.$langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully").'

'; - if ($_error == 2) - { - print '

'.$langs->trans("TheCategorie").' '.$mere->label.' ('.$res.').

'; - } - } + print '

'.$langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully").'

'; print '
'; } }