Fix : prevent fatal error
This commit is contained in:
parent
27134a1f91
commit
e20d669e34
@ -61,6 +61,11 @@ class Validate
|
|||||||
$this->outputLang = $outputLang;
|
$this->outputLang = $outputLang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_object($this->outputLang) || !method_exists($outputLang, 'load')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var Translate $outputLang */
|
||||||
$outputLang->load('validate');
|
$outputLang->load('validate');
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
@ -212,7 +217,7 @@ class Validate
|
|||||||
/**
|
/**
|
||||||
* Check Duration validity
|
* Check Duration validity
|
||||||
*
|
*
|
||||||
* @param string $duration to validate
|
* @param mixed $duration to validate
|
||||||
* @return boolean Validity is ok or not
|
* @return boolean Validity is ok or not
|
||||||
*/
|
*/
|
||||||
public function isDuration($duration)
|
public function isDuration($duration)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user