Leverage the NotFoundHandler in RequestHandler::buildRequest()
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 13 Apr 2023 15:07:31 +0000 (17:07 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 14 Apr 2023 11:54:52 +0000 (13:54 +0200)
wcfsetup/install/files/lib/system/request/RequestHandler.class.php

index 4fb3115fad9101e2a534d65023d9822369d9d24a..b8ee185678ea79cf3314118b439a33f84562e028 100644 (file)
@@ -9,6 +9,7 @@ use Laminas\Diactoros\ServerRequestFilter\FilterUsingXForwardedHeaders;
 use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
 use Psr\Http\Message\RequestInterface;
 use Psr\Http\Message\ResponseInterface;
+use wcf\http\error\NotFoundHandler;
 use wcf\http\error\XsrfValidationFailedHandler;
 use wcf\http\LegacyPlaceholderResponse;
 use wcf\http\middleware\AddAcpSecurityHeaders;
@@ -165,7 +166,6 @@ final class RequestHandler extends SingletonFactory
     /**
      * Builds a new request.
      *
-     * @throws  IllegalLinkException
      * @throws  NamedUserException
      * @throws  SystemException
      */
@@ -281,7 +281,7 @@ final class RequestHandler extends SingletonFactory
                 throw $e;
             }
 
-            throw new IllegalLinkException();
+            return (new NotFoundHandler())->handle($psrRequest);
         }
     }