From: Tim Düsterhus Date: Thu, 19 May 2022 12:52:04 +0000 (+0200) Subject: Return LegacyPlaceholderResponse from `Request::execute()` X-Git-Tag: 6.0.0_Alpha_1~1266^2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f0222e8d3ebfa485891ae1263c9f7b6fd89f5411;p=GitHub%2FWoltLab%2FWCF.git Return LegacyPlaceholderResponse from `Request::execute()` --- diff --git a/wcfsetup/install/files/lib/system/request/Request.class.php b/wcfsetup/install/files/lib/system/request/Request.class.php index a944446784..d65e5bd05b 100644 --- a/wcfsetup/install/files/lib/system/request/Request.class.php +++ b/wcfsetup/install/files/lib/system/request/Request.class.php @@ -2,7 +2,9 @@ namespace wcf\system\request; +use Psr\Http\Message\ResponseInterface; use wcf\data\page\PageCache; +use wcf\http\LegacyPlaceholderResponse; /** * Represents a page request. @@ -82,12 +84,18 @@ class Request /** * Executes this request. */ - public function execute() + public function execute(): ResponseInterface { if ($this->requestObject === null) { $this->requestObject = new $this->className(); - return $this->requestObject->__run(); + $response = $this->requestObject->__run(); + + if ($response instanceof ResponseInterface) { + return $response; + } + + return new LegacyPlaceholderResponse(); } }