From 78fcc20190121d487a2e6cf1fca53b66df67dc3a Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 14 Jun 2021 20:03:19 +0200 Subject: Remove more redundant try/catch blocks Remove all try/catch blocks where the exception handling did not differ from the exception handler already defined by "set_exception_handler". --- admin/auth.php | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'admin/auth.php') diff --git a/admin/auth.php b/admin/auth.php index cec8867..8c6d5a6 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -50,28 +50,19 @@ if(HTTP::issetPOST(['token' => Application::getSecurityToken()], 'username', 'pa } #=============================================================================== -# TRY: Template\Exception +# Build document #=============================================================================== -try { - $AuthTemplate = Template\Factory::build('auth'); - $AuthTemplate->set('FORM', [ - 'INFO' => $messages ?? [], - 'DATA' => [ - 'USERNAME' => HTTP::POST('username'), - 'PASSWORD' => HTTP::POST('password'), - ], - 'TOKEN' => Application::getSecurityToken() - ]); +$AuthTemplate = Template\Factory::build('auth'); +$AuthTemplate->set('FORM', [ + 'INFO' => $messages ?? [], + 'DATA' => [ + 'USERNAME' => HTTP::POST('username'), + 'PASSWORD' => HTTP::POST('password'), + ], + 'TOKEN' => Application::getSecurityToken() +]); - $MainTemplate = Template\Factory::build('main'); - $MainTemplate->set('NAME', 'Authentication'); - $MainTemplate->set('HTML', $AuthTemplate); - echo $MainTemplate; -} - -#=============================================================================== -# CATCH: Template\Exception -#=============================================================================== -catch(Template\Exception $Exception) { - Application::exit($Exception->getMessage()); -} +$MainTemplate = Template\Factory::build('main'); +$MainTemplate->set('NAME', 'Authentication'); +$MainTemplate->set('HTML', $AuthTemplate); +echo $MainTemplate; -- cgit v1.2.3