From 66c1406bbb693b293d69101ba1d5c00e107b16af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Aug 2009 17:46:47 +0000 Subject: [PATCH] Fix: Add warning if trigger was called with wrong parameters --- htdocs/facture.class.php | 2 +- htdocs/interfaces.class.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 6e1a58dafe9..c720c92545f 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -3043,7 +3043,7 @@ class FactureLigne */ function update() { - global $conf; + global $user,$langs,$conf; // Clean parameters $this->desc=trim($this->desc); diff --git a/htdocs/interfaces.class.php b/htdocs/interfaces.class.php index 4d54b46563a..6e6a1378b2d 100644 --- a/htdocs/interfaces.class.php +++ b/htdocs/interfaces.class.php @@ -57,6 +57,12 @@ class Interfaces */ function run_triggers($action,$object,$user,$langs,$conf) { + // Check parameters + if (! is_object($object) || ! is_object($user) || ! is_object($langs) || ! is_object($conf)) + { + dol_syslog('interface::run_triggers was called with wrong parameters object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); + } + $handle=opendir($this->dir); $modules = array(); $nbfile = $nbtotal = $nbok = $nbko = 0;