debug probleme en cas d'apostrophes/guillemets
This commit is contained in:
parent
77e06014f4
commit
d27331eca6
@ -38,10 +38,10 @@ $html = new Form($db);
|
|||||||
if ($_POST["action"] == 'update' && $user->rights->categorie->creer)
|
if ($_POST["action"] == 'update' && $user->rights->categorie->creer)
|
||||||
{
|
{
|
||||||
|
|
||||||
$categorie->label = stripslashes($_POST["nom"]);
|
$categorie->label = $_POST["nom"];
|
||||||
$categorie->description = stripslashes($_POST["description"]);
|
$categorie->description = $_POST["description"];
|
||||||
if($_POST['catMere'] != "-1")
|
if($_POST['catMere'] != "-1")
|
||||||
$categorie->id_mere = stripslashes($_POST['catMere']);
|
$categorie->id_mere = $_POST['catMere'];
|
||||||
|
|
||||||
|
|
||||||
if (!$categorie->label || !$categorie->description)
|
if (!$categorie->label || !$categorie->description)
|
||||||
@ -72,9 +72,9 @@ print '<tr><td valign="top" width="30%">';
|
|||||||
<tr>
|
<tr>
|
||||||
<td><?php print $langs->trans("Label"); ?> :</td>
|
<td><?php print $langs->trans("Label"); ?> :</td>
|
||||||
|
|
||||||
<td><input type='text' size='25' id='nom' name ='nom' value='<?php
|
<td><input type='text' size='25' id='nom' name ='nom' value="<?php
|
||||||
print $categorie->label;
|
print $categorie->label;
|
||||||
?>' />
|
?>" />
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php print $langs->trans("Description"); ?> :</td>
|
<td><?php print $langs->trans("Description"); ?> :</td>
|
||||||
|
|||||||
@ -51,16 +51,16 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
{
|
{
|
||||||
$categorie = new Categorie($db);
|
$categorie = new Categorie($db);
|
||||||
|
|
||||||
$categorie->label = stripslashes($_POST["nom"]);
|
$categorie->label = $_POST["nom"];
|
||||||
$categorie->description = stripslashes($_POST["description"]);
|
$categorie->description = $_POST["description"];
|
||||||
if($_POST['catMere'] != "-1")
|
if($_POST['catMere'] != "-1")
|
||||||
$categorie->id_mere = stripslashes($_POST['catMere']);
|
$categorie->id_mere = $_POST['catMere'];
|
||||||
|
|
||||||
|
|
||||||
if (!$categorie->label || !$categorie->description)
|
if (!$categorie->label || !$categorie->description)
|
||||||
{
|
{
|
||||||
$_GET["action"] = 'create';
|
$_GET["action"] = 'create';
|
||||||
$categorie->error = "Le libellé ou la description n'a pas été renseigné";
|
$categorie->error = $langs->trans(ErrForgotField);
|
||||||
}
|
}
|
||||||
if ($categorie->error =="")
|
if ($categorie->error =="")
|
||||||
{
|
{
|
||||||
@ -68,6 +68,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
{
|
{
|
||||||
$_GET["action"] = 'confirmed';
|
$_GET["action"] = 'confirmed';
|
||||||
$_POST["addcat"] = '';
|
$_POST["addcat"] = '';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -80,19 +81,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
|
|
||||||
print '<table border="0" width="100%">';
|
print '<table border="0" width="100%">';
|
||||||
print '<tr><td valign="top" width="30%">';
|
print '<tr><td valign="top" width="30%">';
|
||||||
|
print '<p>'.$langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully").'</p>';
|
||||||
if ($_error == 3)
|
|
||||||
{
|
|
||||||
print '<p>'.$langs->trans("ImpossibleAddCat").' '.$categorie->label.'</p>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<p>'.$langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully").'</p>';
|
|
||||||
if ($_error == 2)
|
|
||||||
{
|
|
||||||
print '<p>'.$langs->trans("TheCategorie").' '.$mere->label.' ('.$res.').</p>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user