diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 34439edab0b408a7ad54eca38c7d25e587421dc6..61093ebcc5239e0e00e32f2105c12e46f5416658 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2553,7 +2553,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if ($pictoisfullpath) { // Clean parameters - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; + if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png'; $fullpathpicto = $picto; } else @@ -2575,7 +2575,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } // Clean parameters - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; + if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png'; // If alt path are defined, define url where img file is, according to physical path foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...) { diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b7de98b0c1c0b7fc833ea0b1af3977dbf09ba183..64c2d026ab46fb8d22853f1bf1ca361a38913327 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -924,16 +924,16 @@ class Cronjob extends CommonObject // load classes if (! $error) { - $ret=dol_include_once($this->classesname); - if ($ret===false || (! class_exists($this->objectname))) - { - $this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname); - dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); - $this->lastoutput = $this->error; - $this->lastresult = -1; - $retval = $this->lastresult; - $error++; - } + $ret=dol_include_once($this->classesname); + if ($ret===false || (! class_exists($this->objectname))) + { + $this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname); + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + $this->lastoutput = $this->error; + $this->lastresult = -1; + $retval = $this->lastresult; + $error++; + } } // test if method exists @@ -973,6 +973,7 @@ class Cronjob extends CommonObject $object = new $this->objectname($this->db); $params_arr = array_map('trim', explode(",",$this->params)); + if (!is_array($params_arr)) { $result = call_user_func(array($object, $this->methodename), $this->params); @@ -982,7 +983,7 @@ class Cronjob extends CommonObject $result = call_user_func_array(array($object, $this->methodename), $params_arr); } - if ($result===false || $result != 0) + if ($result === false || (! is_bool($result) && $result != 0)) { $langs->load("errors"); dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR); @@ -1031,7 +1032,7 @@ class Cronjob extends CommonObject $result = call_user_func_array($this->methodename, $params_arr); } - if ($result === false || $result != 0) + if ($result === false || (! is_bool($result) && $result != 0)) { $langs->load("errors"); dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);