From 557638b3fe580c6c2caa4b2ae9356d1fd61f2f6c Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 24 Oct 2021 17:31:16 +0200 Subject: [PATCH] PHP8/Misc * reduce redundancy after merge --- index.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/index.php b/index.php index a42ba2bd..41060ec9 100644 --- a/index.php +++ b/index.php @@ -114,19 +114,10 @@ switch ($pageCall) catch (Exception $e) // no, apparently not.. { $class = $cleanName.'Page'; - if (is_callable([$class, 'display'])) - (new $class($pageCall, $pageParam))->display(); - else if (method_exists($class, 'display')) - { - // PHP 8 requires an instance of $class for is_callable to work - $classInstance = new $class($pageCall, $pageParam); - if (is_callable([$classInstance, 'display'])) - $classInstance->display(); - else if (isset($_GET['power'])) - die('$WowheadPower.register(0, '.User::$localeId.', {})'); - else // in conjunction with a proper rewriteRule in .htaccess... - (new GenericPage($pageCall))->error(); - } + $classInstance = new $class($pageCall, $pageParam); + + if (is_callable([$classInstance, 'display'])) + $classInstance->display(); else if (isset($_GET['power'])) die('$WowheadPower.register(0, '.User::$localeId.', {})'); else // in conjunction with a proper rewriteRule in .htaccess...