Merge pull request #13694 from b108/duplicate-functionality-in-request-class

Remove duplicate functionality
This commit is contained in:
Roeland Jago Douma 2019-02-01 11:28:25 +01:00 committed by GitHub
commit 23245904d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -759,11 +759,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
*/ */
public function getRawPathInfo(): string { public function getRawPathInfo(): string {
$requestUri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : ''; $requestUri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : '';
// remove too many leading slashes - can be caused by reverse proxy configuration // remove too many slashes - can be caused by reverse proxy configuration
if (strpos($requestUri, '/') === 0) {
$requestUri = '/' . ltrim($requestUri, '/');
}
$requestUri = preg_replace('%/{2,}%', '/', $requestUri); $requestUri = preg_replace('%/{2,}%', '/', $requestUri);
// Remove the query string from REQUEST_URI // Remove the query string from REQUEST_URI