Use PSR-7 responses in PollAction
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 13 Aug 2021 07:59:35 +0000 (09:59 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 13 Aug 2021 07:59:35 +0000 (09:59 +0200)
wcfsetup/install/files/lib/action/PollAction.class.php

index 5cce6a8b27c1dba3e8490ec793fe66aeb2b8c72e..a809e0396366b3d65c08e7683fe70702bf513720 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace wcf\action;
 
+use Laminas\Diactoros\Response\JsonResponse;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\SystemException;
@@ -152,11 +153,7 @@ class PollAction extends AJAXProxyAction
 
         $this->executed();
 
-        // send JSON-encoded response
-        \header('Content-type: application/json; charset=UTF-8');
-        echo JSON::encode($returnValues);
-
-        exit;
+        return new JsonResponse($returnValues);
     }
 
     /**