浏览代码

Merge remote branch 'Chekote/firefox_put_fix'

* Chekote/firefox_put_fix:
  Fixed content type for urlencoded forms being too specific. For example, this will now function will clients (such as Firefox) that append the charset to the content type header. Uses 0 === strpos() as per @kriswallsmith suggestion.
Fabien Potencier 14 年之前
父节点
当前提交
0cf8ad1946
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Component/HttpFoundation/Request.php

+ 1 - 1
src/Symfony/Component/HttpFoundation/Request.php

@@ -129,7 +129,7 @@ class Request
     {
         $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
 
-        if ('application/x-www-form-urlencoded' == $request->server->get('CONTENT_TYPE')
+        if (0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
             && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE'))
         ) {
             parse_str($request->getContent(), $data);