Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added null type on Request::create docblock #24902

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions 18 src/Symfony/Component/HttpFoundation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ public static function createFromGlobals()
* The information contained in the URI always take precedence
* over the other information (server and parameters).
*
* @param string $uri The URI
* @param string $method The HTTP method
* @param array $parameters The query (GET) or request (POST) parameters
* @param array $cookies The request cookies ($_COOKIE)
* @param array $files The request files ($_FILES)
* @param array $server The server parameters ($_SERVER)
* @param string $content The raw body data
* @param string $uri The URI
* @param string $method The HTTP method
* @param array $parameters The query (GET) or request (POST) parameters
* @param array $cookies The request cookies ($_COOKIE)
* @param array $files The request files ($_FILES)
* @param array $server The server parameters ($_SERVER)
* @param string|null $content The raw body data
Copy link
Member

Choose a reason for hiding this comment

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

it affects not only this method, but other methods and property as well

Copy link
Member

Choose a reason for hiding this comment

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

@keradus what do you mean? Looking at the code, passing null is not supported for the other argument. Yes, technically you can, but then, the behavior is certainly not part of any contract - except for $content.

Copy link
Member

@nicolas-grekas nicolas-grekas Nov 27, 2017

Choose a reason for hiding this comment

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

Oups, I needed to post to actually understand your comment. Other methods :)
@plazma0 would you mind reviewing the $content argument then in other methods?
Please note that this PR should be merged against branch 2.7, so that if you know how to do it (moving the target branch + rebasing your branch), you're welcomed.

*
* @return static
*/
Expand Down Expand Up @@ -1748,7 +1748,7 @@ protected function prepareBaseUrl()

// Does the baseUrl have anything in common with the request_uri?
$requestUri = $this->getRequestUri();
if ($requestUri !== '' && $requestUri[0] !== '/') {
if ('' !== $requestUri && '/' !== $requestUri[0]) {
$requestUri = '/'.$requestUri;
}

Expand Down Expand Up @@ -1824,7 +1824,7 @@ protected function preparePathInfo()
if (false !== $pos = strpos($requestUri, '?')) {
$requestUri = substr($requestUri, 0, $pos);
}
if ($requestUri !== '' && $requestUri[0] !== '/') {
if ('' !== $requestUri && '/' !== $requestUri[0]) {
$requestUri = '/'.$requestUri;
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.