Browse Source

added support for PUT method

Fabien Potencier 14 years ago
parent
commit
efd1f1358c
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/Symfony/Component/HttpFoundation/Request.php

+ 7 - 0
src/Symfony/Component/HttpFoundation/Request.php

@@ -108,6 +108,13 @@ 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;