Update laravel/vendor/Symfony/Component/HttpFoundation/LaravelRequest.php

This will allow the built in PHP 5.4 server to interpret PUT, DELETE, and PATCH content.

It uses the HTTP_CONTENT_TYPE variable instead of CONTENT_TYPE; Symfony hasn't adapted for this yet.
This commit is contained in:
Matthew Machuga 2012-10-24 14:41:58 -03:00
parent e684aa3c00
commit 1a6b7e3d73
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ static public 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->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);