Fix: Gestion erreur sur cration produit en double

This commit is contained in:
Laurent Destailleur 2006-06-08 19:53:55 +00:00
parent b0a5267fab
commit 5c80c27f50
2 changed files with 4 additions and 3 deletions

View File

@ -34,9 +34,11 @@
if (isset($_SERVER['DOL_TUNING'])) $micro_start_time=microtime(true);
// Forcage du parametrage PHP magic_quots_gpc (Sinon il faudrait a chaque POST, conditionner
// Forcage du parametrage PHP magic_quots_gpc et nettoyage des parametres
// (Sinon il faudrait a chaque POST, conditionner
// la lecture de variable par stripslashes selon etat de get_magic_quotes).
// En mode off (recommande il faut juste faire addslashes au moment d'un insert/update.
@set_magic_quotes_runtime(0);
function stripslashes_deep($value)
{
return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value));
@ -48,7 +50,6 @@ if (get_magic_quotes_gpc())
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
@set_magic_quotes_runtime(0);
require_once("master.inc.php");

View File

@ -225,7 +225,7 @@ class Product
$sql .= ",note = '" . addslashes($this->note) ."'";
$sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'";
$sql .= " WHERE rowid = " . $id;
if ( $this->db->query($sql) )
{
// Multilangs