Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a71bce8

Browse files
committed
Merge branch '4.4' into 5.1
2 parents 01a865f + 091265b commit a71bce8

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,9 +1850,15 @@ protected function prepareBaseUrl()
18501850
}
18511851

18521852
$basename = basename($baseUrl);
1853-
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
1854-
// no match whatsoever; set it blank
1855-
return '';
1853+
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
1854+
// strip autoindex filename, for virtualhost based on URL path
1855+
$baseUrl = \dirname($baseUrl).'/';
1856+
1857+
$basename = basename($baseUrl);
1858+
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
1859+
// no match whatsoever; set it blank
1860+
return '';
1861+
}
18561862
}
18571863

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

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,36 @@ public function getBaseUrlData()
17571757
'/foo',
17581758
'/bar+baz',
17591759
],
1760+
[
1761+
'/sub/foo/bar',
1762+
[
1763+
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app.php',
1764+
'SCRIPT_NAME' => '/foo/app.php',
1765+
'PHP_SELF' => '/foo/app.php',
1766+
],
1767+
'/sub/foo',
1768+
'/bar',
1769+
],
1770+
[
1771+
'/sub/foo/app.php/bar',
1772+
[
1773+
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app.php',
1774+
'SCRIPT_NAME' => '/foo/app.php',
1775+
'PHP_SELF' => '/foo/app.php',
1776+
],
1777+
'/sub/foo/app.php',
1778+
'/bar',
1779+
],
1780+
[
1781+
'/sub/foo/bar/baz',
1782+
[
1783+
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app2.phpx',
1784+
'SCRIPT_NAME' => '/foo/app2.phpx',
1785+
'PHP_SELF' => '/foo/app2.phpx',
1786+
],
1787+
'/sub/foo',
1788+
'/bar/baz',
1789+
],
17601790
];
17611791
}
17621792

src/Symfony/Component/Yaml/Parser.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,27 +1190,6 @@ private function parseQuotedString(string $yaml): ?string
11901190
}
11911191

11921192
return $value;
1193-
1194-
for ($i = 1; isset($yaml[$i]) && $quotation !== $yaml[$i]; ++$i) {
1195-
}
1196-
1197-
// quoted single line string
1198-
if (isset($yaml[$i]) && $quotation === $yaml[$i]) {
1199-
return $yaml;
1200-
}
1201-
1202-
$lines = [$yaml];
1203-
1204-
while ($this->moveToNextLine()) {
1205-
for ($i = 1; isset($this->currentLine[$i]) && $quotation !== $this->currentLine[$i]; ++$i) {
1206-
}
1207-
1208-
$lines[] = trim($this->currentLine);
1209-
1210-
if (isset($this->currentLine[$i]) && $quotation === $this->currentLine[$i]) {
1211-
break;
1212-
}
1213-
}
12141193
}
12151194

12161195
private function lexInlineMapping(string $yaml): string

0 commit comments

Comments
 (0)