Skip to content

Commit 1ef038c

Browse files
committed
Merge branch '2.2' into 2.3
* 2.2: [Locale] fixed build-data exit code in case of an error fixed request format of sub-requests when explicitely set by the developer (closes #8787) Sets _format attribute only if it wasn't set previously by the user. Exclude little words of 'ee' to 'oo' plural transformation fixed the format of the request used to render an exception Fix typo in the check_path validator added a missing use statement (closes #8808) fix for Process:isSuccessful() Conflicts: UPGRADE-3.0.md src/Symfony/Component/Locale/Resources/data/build-data.php
2 parents 898bb61 + da950d0 commit 1ef038c

File tree

5 files changed

+51
-1
lines changed

5 files changed

+51
-1
lines changed

DependencyInjection/MainConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
287287
continue;
288288
}
289289

290-
if (false !== strpos('/', $firewall[$k]['check_path']) && !preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) {
290+
if (false !== strpos($firewall[$k]['check_path'], '/') && !preg_match('#'.$firewall['pattern'].'#', $firewall[$k]['check_path'])) {
291291
throw new \LogicException(sprintf('The check_path "%s" for login method "%s" is not matched by the firewall pattern "%s".', $firewall[$k]['check_path'], $k, $firewall['pattern']));
292292
}
293293
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$container->loadFromExtension('security', array(
4+
'providers' => array(
5+
'default' => array('id' => 'foo'),
6+
),
7+
8+
'firewalls' => array(
9+
'some_firewall' => array(
10+
'pattern' => '/secured_area/.*',
11+
'form_login' => array(
12+
'check_path' => '/some_area/login_check',
13+
)
14+
)
15+
)
16+
));
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<srv:container xmlns="http://symfony.com/schema/dic/security"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:srv="http://symfony.com/schema/dic/services"
6+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
7+
8+
<config>
9+
<provider name="default" id="foo" />
10+
11+
<firewall name="some_firewall" pattern="/secured_area/.*">
12+
<form-login check-path="/some_area/login_check" />
13+
</firewall>
14+
</config>
15+
16+
</srv:container>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
security:
2+
providers:
3+
default: { id: foo }
4+
5+
firewalls:
6+
some_firewall:
7+
pattern: /secured_area/.*
8+
form_login:
9+
check_path: /some_area/login_check

Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ public function testCustomAclProvider()
181181
$this->assertEquals('foo', (string) $container->getAlias('security.acl.provider'));
182182
}
183183

184+
/**
185+
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
186+
* @expectedExceptionMessage not matched by the firewall pattern
187+
*/
188+
public function testInvalidCheckPath()
189+
{
190+
$container = $this->getContainer('invalid_check_path');
191+
}
192+
184193
protected function getContainer($file)
185194
{
186195
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)