Skip to content

Update LaravelRequest.php to alllow PUT/DELETE/PATCH on PHP5.4 built-in server #1384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2012
Merged

Conversation

machuga
Copy link
Contributor

@machuga machuga commented Oct 24, 2012

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.

….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.
@daylerees
Copy link
Contributor

Mmmm pull.

daylerees added a commit that referenced this pull request Oct 24, 2012
Update LaravelRequest.php to alllow PUT/DELETE/PATCH on PHP5.4 built-in server
@daylerees daylerees merged commit 5e3a8de into laravel:develop Oct 24, 2012
@franzliedke
Copy link
Contributor

Shouldn't that pull request go straight to Symfony, @machuga ?

@franzliedke
Copy link
Contributor

Wait, that was a stupid comment, wasn't it? Looks like this is a Laravel file. But why is it in the Symfony directory?

@machuga
Copy link
Contributor Author

machuga commented Oct 24, 2012

@franzliedke It's separate for some slight changes. I'm going to send the same patch to symfony proper as well and see what they think.

@@ -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')))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI it's more consistent with the rest of the Laravel code to use "or" instead of "||"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jakobud Indeed, it's normally preferred - however this is a file derived from a Symfony file - in the rest of the Symfony Request object they use '||'. Additionally, '&&' is also used in the same conditional - jumbling up '&&' with 'or' would be pretty weird.

zoe-edwards pushed a commit to zoe-edwards/laravel that referenced this pull request Oct 14, 2013
…ion-test

Fixed failing unit test for SQL Server Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants