From e20d669e34276d30695c83454cd2ecbad3551d5c Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Tue, 28 Dec 2021 19:08:47 +0100 Subject: [PATCH] Fix : prevent fatal error --- htdocs/core/class/validate.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php index 1b2447dc23a..389bb708e82 100644 --- a/htdocs/core/class/validate.class.php +++ b/htdocs/core/class/validate.class.php @@ -61,6 +61,11 @@ class Validate $this->outputLang = $outputLang; } + if (!is_object($this->outputLang) || !method_exists($outputLang, 'load')) { + return false; + } + + /** @var Translate $outputLang */ $outputLang->load('validate'); $this->db = $db; @@ -212,7 +217,7 @@ class Validate /** * Check Duration validity * - * @param string $duration to validate + * @param mixed $duration to validate * @return boolean Validity is ok or not */ public function isDuration($duration)