Use PSR-7 responses in AbstractDialogAction
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 10 Aug 2021 13:40:45 +0000 (15:40 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 Aug 2021 14:29:54 +0000 (16:29 +0200)
wcfsetup/install/files/lib/action/AbstractDialogAction.class.php

index f7e51005144037f72a56cbf70d007480103797db..eb5df893c0a465250e5d2e68c7e3777e96dd3db3 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace wcf\action;
 
+use Laminas\Diactoros\Response\JsonResponse;
 use wcf\system\exception\AJAXException;
 use wcf\system\exception\IllegalLinkException;
-use wcf\util\JSON;
 use wcf\util\StringUtil;
 
 /**
@@ -74,11 +74,7 @@ abstract class AbstractDialogAction extends AbstractSecureAction
 
         $this->executed();
 
-        // send JSON-encoded response
-        \header('Content-type: application/json; charset=UTF-8');
-        echo JSON::encode($this->data);
-
-        exit;
+        return new JsonResponse($this->data);
     }
 
     /**