From: Tim Düsterhus Date: Thu, 19 May 2022 13:15:16 +0000 (+0200) Subject: Support `RequestHandlerInterface`-based controllers in `wcf\system\request\Request` X-Git-Tag: 6.0.0_Alpha_1~1266^2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b5cd222372a6dcbf0688fe0273ebc60def46e570;p=GitHub%2FWoltLab%2FWCF.git Support `RequestHandlerInterface`-based controllers in `wcf\system\request\Request` --- diff --git a/wcfsetup/install/files/lib/system/request/Request.class.php b/wcfsetup/install/files/lib/system/request/Request.class.php index 7cc51e507f..d20c144fae 100644 --- a/wcfsetup/install/files/lib/system/request/Request.class.php +++ b/wcfsetup/install/files/lib/system/request/Request.class.php @@ -92,13 +92,17 @@ final class Request implements RequestHandlerInterface $this->requestObject = new $this->className(); } - $response = $this->requestObject->__run(); + if ($this->requestObject instanceof RequestHandlerInterface) { + return $this->requestObject->handle($request); + } else { + $response = $this->requestObject->__run(); - if ($response instanceof ResponseInterface) { - return $response; + if ($response instanceof ResponseInterface) { + return $response; + } else { + return new LegacyPlaceholderResponse(); + } } - - return new LegacyPlaceholderResponse(); } /**