VENOM: FIX PHP8!

This commit is contained in:
Maurice Grönwoldt 2020-11-30 09:01:31 +01:00
parent 5c44d50989
commit 3d92f5347a

View file

@ -106,10 +106,13 @@ class Router
public function tryFunctionCall(?array $aRoute): bool
{
if ($aRoute === null || !is_callable(array($aRoute['cl'], $aRoute['fnc']))) {
if ($aRoute === null || empty($aRoute['cl']) || empty($aRoute['fnc']) || !class_exists($aRoute['cl'])) {
return false;
}
$route = new $aRoute['cl']();
if (!is_callable(array($route, $aRoute['fnc']))) {
return false;
}
try {
$fnc = $aRoute['fnc'];
$params = $aRoute['params'] ?? [];