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 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; return false;
} }
$route = new $aRoute['cl'](); $route = new $aRoute['cl']();
if (!is_callable(array($route, $aRoute['fnc']))) {
return false;
}
try { try {
$fnc = $aRoute['fnc']; $fnc = $aRoute['fnc'];
$params = $aRoute['params'] ?? []; $params = $aRoute['params'] ?? [];