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

Commit bb774d2

Browse filesBrowse files
committed
Revert #38614, add assert to avoid regression
1 parent 6af4446 commit bb774d2
Copy full SHA for bb774d2

File tree

Expand file treeCollapse file tree

2 files changed

+17
-13
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+17
-13
lines changed

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+3-9Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,15 +1836,9 @@ protected function prepareBaseUrl()
18361836
}
18371837

18381838
$basename = basename($baseUrl);
1839-
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
1840-
// strip autoindex filename, for virtualhost based on URL path
1841-
$baseUrl = \dirname($baseUrl).'/';
1842-
1843-
$basename = basename($baseUrl);
1844-
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
1845-
// no match whatsoever; set it blank
1846-
return '';
1847-
}
1839+
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
1840+
// no match whatsoever; set it blank
1841+
return '';
18481842
}
18491843

18501844
// If using mod_rewrite or ISAPI_Rewrite strip the script filename

‎src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
+14-4Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,8 +1770,8 @@ public function getBaseUrlData()
17701770
'SCRIPT_NAME' => '/foo/app.php',
17711771
'PHP_SELF' => '/foo/app.php',
17721772
],
1773-
'/sub/foo',
1774-
'/bar',
1773+
'',
1774+
'/sub/foo/bar',
17751775
],
17761776
[
17771777
'/sub/foo/app.php/bar',
@@ -1790,8 +1790,18 @@ public function getBaseUrlData()
17901790
'SCRIPT_NAME' => '/foo/app2.phpx',
17911791
'PHP_SELF' => '/foo/app2.phpx',
17921792
],
1793-
'/sub/foo',
1794-
'/bar/baz',
1793+
'',
1794+
'/sub/foo/bar/baz',
1795+
],
1796+
[
1797+
'/foo/api/bar',
1798+
[
1799+
'SCRIPT_FILENAME' => '/home/user/public_html/api/index.php',
1800+
'SCRIPT_NAME' => '/api/index.php',
1801+
'PHP_SELF' => '/api/index.php',
1802+
],
1803+
'',
1804+
'/foo/api/bar',
17951805
],
17961806
];
17971807
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.