From f0222e8d3ebfa485891ae1263c9f7b6fd89f5411 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 19 May 2022 14:52:04 +0200 Subject: [PATCH] Return LegacyPlaceholderResponse from `Request::execute()` --- .../files/lib/system/request/Request.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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(); } } -- 2.20.1