@@ -108,13 +108,6 @@ public function initialize(array $query = array(), array $request = array(), arr
108
108
$ this ->server = new ServerBag ($ server );
109
109
$ this ->headers = new HeaderBag ($ this ->server ->getHeaders ());
110
110
111
- if ('application/x-www-form-urlencoded ' == $ this ->server ->get ('CONTENT_TYPE ' )
112
- && in_array (strtoupper ($ this ->server ->get ('REQUEST_METHOD ' , 'GET ' ), array ('PUT ' , 'DELETE ' ))
113
- ) {
114
- parse_str ($ this ->getContent (), $ data );
115
- $ this ->request = new ParameterBag ($ data );
116
- }
117
-
118
111
$ this ->content = $ content ;
119
112
$ this ->languages = null ;
120
113
$ this ->charsets = null ;
@@ -134,7 +127,16 @@ public function initialize(array $query = array(), array $request = array(), arr
134
127
*/
135
128
static public function createFromGlobals ()
136
129
{
137
- return new static ($ _GET , $ _POST , array (), $ _COOKIE , $ _FILES , $ _SERVER );
130
+ $ request = new static ($ _GET , $ _POST , array (), $ _COOKIE , $ _FILES , $ _SERVER );
131
+
132
+ if ('application/x-www-form-urlencoded ' == $ request ->server ->get ('CONTENT_TYPE ' )
133
+ && in_array (strtoupper ($ request ->server ->get ('REQUEST_METHOD ' , 'GET ' ), array ('PUT ' , 'DELETE ' ))
134
+ ) {
135
+ parse_str ($ this ->getContent (), $ data );
136
+ $ request ->request = new ParameterBag ($ data );
137
+ }
138
+
139
+ return $ request ;
138
140
}
139
141
140
142
/**
0 commit comments