[BUGFIX] Assure that $_POST is never set to null 82/58682/4
authorDaniel Goerz <daniel.goerz@posteo.de>
Wed, 24 Oct 2018 08:05:24 +0000 (10:05 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 24 Oct 2018 13:04:09 +0000 (15:04 +0200)
Resolves: #86731
Releases: master
Change-Id: Ia48925cf98637d7c7b2ecfb071bc935508032dec
Reviewed-on: https://review.typo3.org/58682
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Daniel Sattler <sattler@b13.de>
Tested-by: Daniel Sattler <sattler@b13.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/Http/RequestHandler.php

index ae7e3c6..b68fef7 100644 (file)
@@ -126,10 +126,12 @@ class RequestHandler implements RequestHandlerInterface, PsrRequestHandlerInterf
             $_GET = $queryParams;
             $GLOBALS['HTTP_GET_VARS'] = $_GET;
         }
-        if ($request->getMethod() === 'POST' && $request->getParsedBody() !== $_POST) {
+        if ($request->getMethod() === 'POST') {
             $parsedBody = $request->getParsedBody();
-            $_POST = $parsedBody;
-            $GLOBALS['HTTP_POST_VARS'] = $_POST;
+            if (is_array($parsedBody) && $parsedBody !== $_POST) {
+                $_POST = $parsedBody;
+                $GLOBALS['HTTP_POST_VARS'] = $_POST;
+            }
         }
     }
     /**