Skip to content

Commit bdbdf73

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: 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 263eda3 + 01229fb commit bdbdf73

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
@@ -207,6 +207,8 @@
207207
<xsd:attribute name="cache" type="xsd:string" />
208208
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
209209
<xsd:attribute name="static-method" type="xsd:boolean" />
210+
<xsd:attribute name="translation-domain" type="xsd:string" />
211+
<xsd:attribute name="strict-email" type="xsd:boolean" />
210212
<xsd:attribute name="api" type="validator_api_version" />
211213
</xsd:complexType>
212214

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
@@ -428,6 +428,20 @@ public function testValidationNoStaticMethod()
428428
// no cache, no annotations, no static methods
429429
}
430430

431+
public function testValidationTranslationDomain()
432+
{
433+
$container = $this->createContainerFromFile('validation_translation_domain');
434+
435+
$this->assertSame('messages', $container->getParameter('validator.translation_domain'));
436+
}
437+
438+
public function testValidationStrictEmail()
439+
{
440+
$container = $this->createContainerFromFile('validation_strict_email');
441+
442+
$this->assertTrue($container->getDefinition('validator.email')->getArgument(0));
443+
}
444+
431445
public function testFormsCanBeEnabledWithoutCsrfProtection()
432446
{
433447
$container = $this->createContainerFromFile('form_no_csrf');

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

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

288288
if (0 === strpos($token, '-') && 0 !== strpos($token, '--')) {
289+
$noValue = explode('=', $token);
290+
$token = $noValue[0];
289291
$searchableToken = str_replace('-', '', $token);
290292
$searchableValue = str_replace('-', '', $value);
291293
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
@@ -299,6 +299,9 @@ public function testHasParameterOption()
299299
$input = new ArgvInput(array('cli.php', '-fh'));
300300
$this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
301301

302+
$input = new ArgvInput(array('cli.php', '-e=test'));
303+
$this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
304+
302305
$input = new ArgvInput(array('cli.php', '--foo', 'foo'));
303306
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
304307

0 commit comments

Comments
 (0)