Merge branch '5.2' into 5.x
* 5.2: remove unreachable code [Browserkit] Add changelog entry for request parameters string cast Update ExceptionEvent.php fix firebase transport factory DI tag type [Validator] Resolve IsinValidator's dependency on the validator. [HttpFoundation] Fix for virtualhosts based on URL path
This commit is contained in:
commit
2a453c2c89
@ -73,7 +73,7 @@ return static function (ContainerConfigurator $container) {
|
|||||||
|
|
||||||
->set('notifier.transport_factory.firebase', FirebaseTransportFactory::class)
|
->set('notifier.transport_factory.firebase', FirebaseTransportFactory::class)
|
||||||
->parent('notifier.transport_factory.abstract')
|
->parent('notifier.transport_factory.abstract')
|
||||||
->tag('texter.transport_factory')
|
->tag('chatter.transport_factory')
|
||||||
|
|
||||||
->set('notifier.transport_factory.freemobile', FreeMobileTransportFactory::class)
|
->set('notifier.transport_factory.freemobile', FreeMobileTransportFactory::class)
|
||||||
->parent('notifier.transport_factory.abstract')
|
->parent('notifier.transport_factory.abstract')
|
||||||
|
@ -6,6 +6,11 @@ CHANGELOG
|
|||||||
|
|
||||||
* Added `jsonRequest` method to `AbstractBrowser`
|
* Added `jsonRequest` method to `AbstractBrowser`
|
||||||
|
|
||||||
|
5.2.0
|
||||||
|
-----
|
||||||
|
|
||||||
|
* [BC BREAK] Request parameters are now casted to string in `Request::__construct()`.
|
||||||
|
|
||||||
4.3.0
|
4.3.0
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -1907,9 +1907,15 @@ class Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
$basename = basename($baseUrl);
|
$basename = basename($baseUrl);
|
||||||
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
|
if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.$basename.'/')) {
|
||||||
// no match whatsoever; set it blank
|
// strip autoindex filename, for virtualhost based on URL path
|
||||||
return '';
|
$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
|
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
|
||||||
|
@ -1785,6 +1785,36 @@ class RequestTest extends TestCase
|
|||||||
'/foo',
|
'/foo',
|
||||||
'/bar+baz',
|
'/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',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ use Symfony\Component\Validator\Constraint;
|
|||||||
use Symfony\Component\Validator\ConstraintValidator;
|
use Symfony\Component\Validator\ConstraintValidator;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Laurent Masforné <l.masforne@gmail.com>
|
* @author Laurent Masforné <l.masforne@gmail.com>
|
||||||
@ -24,16 +23,6 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
|||||||
*/
|
*/
|
||||||
class IsinValidator extends ConstraintValidator
|
class IsinValidator extends ConstraintValidator
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @var ValidatorInterface
|
|
||||||
*/
|
|
||||||
private $validator;
|
|
||||||
|
|
||||||
public function __construct(ValidatorInterface $validator)
|
|
||||||
{
|
|
||||||
$this->validator = $validator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@ -87,6 +76,6 @@ class IsinValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
$number = implode('', $characters);
|
$number = implode('', $characters);
|
||||||
|
|
||||||
return 0 === $this->validator->validate($number, new Luhn())->count();
|
return 0 === $this->context->getValidator()->validate($number, new Luhn())->count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,16 +4,14 @@ namespace Symfony\Component\Validator\Tests\Constraints;
|
|||||||
|
|
||||||
use Symfony\Component\Validator\Constraints\Isin;
|
use Symfony\Component\Validator\Constraints\Isin;
|
||||||
use Symfony\Component\Validator\Constraints\IsinValidator;
|
use Symfony\Component\Validator\Constraints\IsinValidator;
|
||||||
|
use Symfony\Component\Validator\Constraints\Luhn;
|
||||||
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||||
use Symfony\Component\Validator\ValidatorBuilder;
|
|
||||||
|
|
||||||
class IsinValidatorTest extends ConstraintValidatorTestCase
|
class IsinValidatorTest extends ConstraintValidatorTestCase
|
||||||
{
|
{
|
||||||
protected function createValidator()
|
protected function createValidator()
|
||||||
{
|
{
|
||||||
$validatorBuilder = new ValidatorBuilder();
|
return new IsinValidator();
|
||||||
|
|
||||||
return new IsinValidator($validatorBuilder->getValidator());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNullIsValid()
|
public function testNullIsValid()
|
||||||
@ -36,6 +34,7 @@ class IsinValidatorTest extends ConstraintValidatorTestCase
|
|||||||
public function testValidIsin($isin)
|
public function testValidIsin($isin)
|
||||||
{
|
{
|
||||||
$this->validator->validate($isin, new Isin());
|
$this->validator->validate($isin, new Isin());
|
||||||
|
$this->expectViolationsAt(0, $isin, new Luhn());
|
||||||
$this->assertNoViolation();
|
$this->assertNoViolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +102,7 @@ class IsinValidatorTest extends ConstraintValidatorTestCase
|
|||||||
*/
|
*/
|
||||||
public function testIsinWithValidFormatButIncorrectChecksum($isin)
|
public function testIsinWithValidFormatButIncorrectChecksum($isin)
|
||||||
{
|
{
|
||||||
|
$this->expectViolationsAt(0, $isin, new Luhn());
|
||||||
$this->assertViolationRaised($isin, Isin::INVALID_CHECKSUM_ERROR);
|
$this->assertViolationRaised($isin, Isin::INVALID_CHECKSUM_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,27 +1190,6 @@ class Parser
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
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
|
private function lexInlineMapping(string $yaml): string
|
||||||
|
Reference in New Issue
Block a user