diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 7ce29c3a7be0..d28f9fc2101d 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -217,7 +217,7 @@ public static function createFromGlobals() { $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); - if (0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') + if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH')) ) { parse_str($request->getContent(), $data); @@ -1043,7 +1043,7 @@ public function setRequestFormat($format) */ public function getContentType() { - return $this->getFormat($this->server->get('CONTENT_TYPE')); + return $this->getFormat($this->headers->get('CONTENT_TYPE')); } /**