From 08846af9e23e08e57825e1f6717fcc68ce72682e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 11 May 2011 10:30:57 +0200 Subject: [PATCH] [HttpFoundation] moved the PUT magic dance in createFromGlobals() --- .../Component/HttpFoundation/Request.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index b4e37011c7..b42ca9bde0 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -108,13 +108,6 @@ class Request $this->server = new ServerBag($server); $this->headers = new HeaderBag($this->server->getHeaders()); - if ('application/x-www-form-urlencoded' == $this->server->get('CONTENT_TYPE') - && in_array(strtoupper($this->server->get('REQUEST_METHOD', 'GET'), array('PUT', 'DELETE')) - ) { - parse_str($this->getContent(), $data); - $this->request = new ParameterBag($data); - } - $this->content = $content; $this->languages = null; $this->charsets = null; @@ -134,7 +127,16 @@ class Request */ static public function createFromGlobals() { - return new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); + $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); + + if ('application/x-www-form-urlencoded' == $request->server->get('CONTENT_TYPE') + && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET'), array('PUT', 'DELETE')) + ) { + parse_str($this->getContent(), $data); + $request->request = new ParameterBag($data); + } + + return $request; } /**