diff --git a/system/functions.php b/system/functions.php index 8f41dad9..5c188804 100644 --- a/system/functions.php +++ b/system/functions.php @@ -201,7 +201,7 @@ function getFlagImage($country): string * @param mixed $v Variable to check. * @return bool Value boolean status. */ -function getBoolean($v): bool +function getBoolean(mixed $v): bool { if(is_bool($v)) { return $v; @@ -210,6 +210,10 @@ function getBoolean($v): bool if(is_numeric($v)) return (int)$v > 0; + if (is_null($v)) { + return false; + } + $v = strtolower($v); return $v === 'yes' || $v === 'true'; } diff --git a/system/libs/pot/OTS_Monster.php b/system/libs/pot/OTS_Monster.php index 244a0229..19482dce 100644 --- a/system/libs/pot/OTS_Monster.php +++ b/system/libs/pot/OTS_Monster.php @@ -41,9 +41,10 @@ class OTS_Monster extends DOMDocument { private $loaded = false; - public function loadXML($source , $options = 0) + public function loadXML(string $source , int $options = 0): bool { $this->loaded = parent::loadXML($source, $options); + return $this->loaded; } public function loaded()