From: Tim Düsterhus Date: Fri, 14 Apr 2023 12:41:23 +0000 (+0200) Subject: Move the “exception escapes from middleware” detection further out X-Git-Tag: 6.0.0_Alpha_1~255^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f64ea34cfc00430dad64d91067a3dacc648d9519;p=GitHub%2FWoltLab%2FWCF.git Move the “exception escapes from middleware” detection further out Since abd060c56250c1a340732b8180c90efd49727ee9 there should not be such an exception even during routing, not just after the middleware stack terminates. --- diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 8e8e602250..0b511b0c23 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -137,14 +137,7 @@ final class RequestHandler extends SingletonFactory new HandleValinorMappingErrors(), ]); - try { - $response = $pipeline->process($psrRequest, $this->getActiveRequest()); - } catch (IllegalLinkException | PermissionDeniedException | InvalidSecurityTokenException $e) { - throw new \LogicException(\sprintf( - "'%s' escaped from the middleware stack.", - $e::class - ), 0, $e); - } + $response = $pipeline->process($psrRequest, $this->getActiveRequest()); if ($response instanceof LegacyPlaceholderResponse) { return; @@ -156,6 +149,11 @@ final class RequestHandler extends SingletonFactory $emitter = new SapiEmitter(); $emitter->emit($response); + } catch (IllegalLinkException | PermissionDeniedException | InvalidSecurityTokenException $e) { + throw new \LogicException(\sprintf( + "'%s' escaped from the middleware stack.", + $e::class + ), 0, $e); } catch (NamedUserException $e) { $e->show();