From: Tim Düsterhus Date: Thu, 19 May 2022 14:11:57 +0000 (+0200) Subject: Inline RequestHandler::sendPsr7Response() X-Git-Tag: 6.0.0_Alpha_1~1266^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e2fda55c74ed0f26fddf33011ff1dcba34fc752e;p=GitHub%2FWoltLab%2FWCF.git Inline RequestHandler::sendPsr7Response() --- diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index 1d36882fd4..43a93b59db 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -4,7 +4,6 @@ namespace wcf\system\request; use Laminas\Diactoros\ServerRequestFactory; use Laminas\HttpHandlerRunner\Emitter\SapiEmitter; -use Psr\Http\Message\ResponseInterface; use wcf\http\LegacyPlaceholderResponse; use wcf\http\middleware\EnforceCacheControlPrivate; use wcf\http\middleware\EnforceFrameOptions; @@ -110,9 +109,14 @@ class RequestHandler extends SingletonFactory new EnforceFrameOptions(), ]); - $this->sendPsr7Response( - $pipeline->process($psrRequest, $this->getActiveRequest()) - ); + $response = $pipeline->process($psrRequest, $this->getActiveRequest()); + + if ($response instanceof LegacyPlaceholderResponse) { + return; + } + + $emitter = new SapiEmitter(); + $emitter->emit($response); } catch (NamedUserException $e) { $e->show(); @@ -120,19 +124,6 @@ class RequestHandler extends SingletonFactory } } - /** - * @since 5.5 - */ - private function sendPsr7Response(ResponseInterface $response) - { - if ($response instanceof LegacyPlaceholderResponse) { - return; - } - - $emitter = new SapiEmitter(); - $emitter->emit($response); - } - /** * Builds a new request. *