Skip to content

Commit 13f58b4

Browse files
committed
Merge branch '2.8' into 3.3
* 2.8: Preserve percent-encoding in URLs when performing redirects in the UrlMatcher [Console] Fix a bug when passing a letter that could be an alias add missing validation options to XSD file
2 parents 258776b + bdbdf73 commit 13f58b4

File tree

16 files changed

+160
-15
lines changed

16 files changed

+160
-15
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@
197197
<xsd:attribute name="cache" type="xsd:string" />
198198
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
199199
<xsd:attribute name="static-method" type="xsd:boolean" />
200+
<xsd:attribute name="translation-domain" type="xsd:string" />
201+
<xsd:attribute name="strict-email" type="xsd:boolean" />
200202
</xsd:complexType>
201203

202204
<xsd:complexType name="file_mapping">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', array(
4+
'validation' => array(
5+
'strict_email' => true,
6+
),
7+
));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', array(
4+
'validation' => array(
5+
'translation_domain' => 'messages',
6+
),
7+
));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config>
9+
<framework:validation strict-email="true" />
10+
</framework:config>
11+
</container>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config>
9+
<framework:validation translation-domain="messages" />
10+
</framework:config>
11+
</container>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
validation:
3+
strict_email: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
validation:
3+
translation_domain: messages

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,20 @@ public function testValidationNoStaticMethod()
658658
// no cache, no annotations, no static methods
659659
}
660660

661+
public function testValidationTranslationDomain()
662+
{
663+
$container = $this->createContainerFromFile('validation_translation_domain');
664+
665+
$this->assertSame('messages', $container->getParameter('validator.translation_domain'));
666+
}
667+
668+
public function testValidationStrictEmail()
669+
{
670+
$container = $this->createContainerFromFile('validation_strict_email');
671+
672+
$this->assertTrue($container->getDefinition('validator.email')->getArgument(0));
673+
}
674+
661675
public function testValidationMapping()
662676
{
663677
$container = $this->createContainerFromFile('validation_mapping');

src/Symfony/Component/Console/Input/ArgvInput.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ public function hasParameterOption($values, $onlyParams = false)
287287
}
288288

289289
if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) {
290+
$noValue = explode('=', $token);
291+
$token = $noValue[0];
290292
$searchableToken = str_replace('-', '', $token);
291293
$searchableValue = str_replace('-', '', $value);
292294
if ('' !== $searchableToken && '' !== $searchableValue && false !== strpos($searchableToken, $searchableValue)) {

src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@ public function testHasParameterOption()
317317
$input = new ArgvInput(array('cli.php', '-fh'));
318318
$this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
319319

320+
$input = new ArgvInput(array('cli.php', '-e=test'));
321+
$this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
322+
320323
$input = new ArgvInput(array('cli.php', '--foo', 'foo'));
321324
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
322325

0 commit comments

Comments
 (0)