[BUGFIX] PSR-7 properties must be initialized as array 69/49969/3
authorPatrik Karisch <p.karisch@pixelart.at>
Mon, 19 Sep 2016 02:03:04 +0000 (04:03 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 19 Sep 2016 09:57:07 +0000 (11:57 +0200)
All the PSR-7 ServerRequest properties must be initialized as arrays, as
they can be accessed through getters without be correctly initialized
from the outside application. This can result in type errors.

Resolves: #77989
Releases: master, 7.6
Change-Id: Iba4d48f710e423316910320392e335c4380fd72d
Reviewed-on: https://review.typo3.org/49969
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Http/ServerRequest.php

index 2189c78..9036120 100644 (file)
@@ -36,12 +36,12 @@ class ServerRequest extends Request implements ServerRequestInterface
     /**
      * @var array
      */
-    protected $attributes;
+    protected $attributes = [];
 
     /**
      * @var array
      */
-    protected $cookieParams;
+    protected $cookieParams = [];
 
     /**
      * @var array
@@ -51,17 +51,17 @@ class ServerRequest extends Request implements ServerRequestInterface
     /**
      * @var array
      */
-    protected $queryParams;
+    protected $queryParams = [];
 
     /**
      * @var array
      */
-    protected $serverParams;
+    protected $serverParams = [];
 
     /**
      * @var array
      */
-    protected $uploadedFiles;
+    protected $uploadedFiles = [];
 
     /**
      * Constructor, the only place to set all parameters of this Message/Request