Merge branch '5.1' into 5.2

* 5.1:
  remove unreachable code
  Update ExceptionEvent.php
  fix firebase transport factory DI tag type
  [HttpFoundation] Fix for virtualhosts based on URL path
This commit is contained in:
Alexander M. Turek 2020-11-16 00:02:13 +01:00
commit 5a9a7be6e5
4 changed files with 40 additions and 25 deletions

View File

@ -73,7 +73,7 @@ return static function (ContainerConfigurator $container) {
->set('notifier.transport_factory.firebase', FirebaseTransportFactory::class)
->parent('notifier.transport_factory.abstract')
->tag('texter.transport_factory')
->tag('chatter.transport_factory')
->set('notifier.transport_factory.freemobile', FreeMobileTransportFactory::class)
->parent('notifier.transport_factory.abstract')

View File

@ -1907,9 +1907,15 @@ class Request
}
$basename = basename($baseUrl);
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
// no match whatsoever; set it blank
return '';
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
// strip autoindex filename, for virtualhost based on URL path
$baseUrl = \dirname($baseUrl).'/';
$basename = basename($baseUrl);
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
// no match whatsoever; set it blank
return '';
}
}
// If using mod_rewrite or ISAPI_Rewrite strip the script filename

View File

@ -1785,6 +1785,36 @@ class RequestTest extends TestCase
'/foo',
'/bar+baz',
],
[
'/sub/foo/bar',
[
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app.php',
'SCRIPT_NAME' => '/foo/app.php',
'PHP_SELF' => '/foo/app.php',
],
'/sub/foo',
'/bar',
],
[
'/sub/foo/app.php/bar',
[
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app.php',
'SCRIPT_NAME' => '/foo/app.php',
'PHP_SELF' => '/foo/app.php',
],
'/sub/foo/app.php',
'/bar',
],
[
'/sub/foo/bar/baz',
[
'SCRIPT_FILENAME' => '/home/John Doe/public_html/foo/app2.phpx',
'SCRIPT_NAME' => '/foo/app2.phpx',
'PHP_SELF' => '/foo/app2.phpx',
],
'/sub/foo',
'/bar/baz',
],
];
}

View File

@ -1190,27 +1190,6 @@ class Parser
}
return $value;
for ($i = 1; isset($yaml[$i]) && $quotation !== $yaml[$i]; ++$i) {
}
// quoted single line string
if (isset($yaml[$i]) && $quotation === $yaml[$i]) {
return $yaml;
}
$lines = [$yaml];
while ($this->moveToNextLine()) {
for ($i = 1; isset($this->currentLine[$i]) && $quotation !== $this->currentLine[$i]; ++$i) {
}
$lines[] = trim($this->currentLine);
if (isset($this->currentLine[$i]) && $quotation === $this->currentLine[$i]) {
break;
}
}
}
private function lexInlineMapping(string $yaml): string