Browse Source

Merge pull request #1384 from machuga/patch-1

Update LaravelRequest.php to alllow PUT/DELETE/PATCH on PHP5.4 built-in server
Dayle Rees 12 years ago
parent
commit
5e3a8de1ba

+ 2 - 1
laravel/vendor/Symfony/Component/HttpFoundation/LaravelRequest.php

@@ -13,7 +13,8 @@ class LaravelRequest extends Request {
     {
         $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->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
+    		|| (0 === strpos($request->server->get('HTTP_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);