From 4dfe137efc1fb1dfea1ae435335749218d13c2cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 10 Aug 2021 14:49:29 +0200 Subject: [PATCH] Use PSR-7 responses in AJAXUploadAction The IE 9 fallback technically should no longer be required, but the (legacy) JavaScript still references the `isFallback` parameter. --- .../install/files/lib/action/AJAXUploadAction.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/action/AJAXUploadAction.class.php b/wcfsetup/install/files/lib/action/AJAXUploadAction.class.php index e20aace511..2216038552 100644 --- a/wcfsetup/install/files/lib/action/AJAXUploadAction.class.php +++ b/wcfsetup/install/files/lib/action/AJAXUploadAction.class.php @@ -2,6 +2,7 @@ namespace wcf\action; +use Laminas\Diactoros\Response\JsonResponse; use wcf\system\upload\UploadHandler; use wcf\util\JSON; @@ -34,10 +35,10 @@ class AJAXUploadAction extends AJAXProxyAction parent::sendResponse(); } + $response = new JsonResponse($this->response); // IE9 is mad if iframe response is application/json - \header('Content-type: text/plain'); - echo JSON::encode($this->response); + $response = $response->withHeader('content-type', 'text/plain'); - exit; + return $response; } } -- 2.20.1