From abd060c56250c1a340732b8180c90efd49727ee9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 13 Apr 2023 17:11:02 +0200 Subject: [PATCH] Remove the final IllegalLinkException from RequestHandler::handle() --- .../files/lib/system/request/RequestHandler.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index e02c96cf4c..8e8e602250 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -103,15 +103,15 @@ final class RequestHandler extends SingletonFactory throw new NamedUserException('Failed to parse the incoming request.', 0, $e); } - if (!RouteHandler::getInstance()->matches()) { + if (RouteHandler::getInstance()->matches()) { + $builtRequest = $this->buildRequest($psrRequest, $application); + } else { if (ENABLE_DEBUG_MODE) { throw new SystemException("Cannot handle request, no valid route provided."); - } else { - throw new IllegalLinkException(); } - } - $builtRequest = $this->buildRequest($psrRequest, $application); + $builtRequest = (new NotFoundHandler())->handle($psrRequest); + } if ($builtRequest instanceof Request) { $this->activeRequest = $builtRequest; -- 2.20.1