Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad9008e

Browse filesBrowse files
committed
Merge branch '2.2' into 2.3
* 2.2: Teardown used wrong property Modified guessDefaultEscapingStrategy to not escape txt templates Fix DateType for 32bits computers. Fixed the registration of validation.xml file when the form is disabled When getting the session's id, check if the session is not closed
2 parents 2f89250 + 9ec6a9c commit ad9008e
Copy full SHA for ad9008e

File tree

Expand file treeCollapse file tree

7 files changed

+41
-6
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+41
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,13 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
627627

628628
private function getValidatorXmlMappingFiles(ContainerBuilder $container)
629629
{
630-
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
631-
$files = array(dirname($reflClass->getFileName()).'/Resources/config/validation.xml');
632-
$container->addResource(new FileResource($files[0]));
630+
$files = array();
631+
632+
if (interface_exists('Symfony\Component\Form\FormInterface')) {
633+
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
634+
$files[] = dirname($reflClass->getFileName()).'/Resources/config/validation.xml';
635+
$container->addResource(new FileResource($files[0]));
636+
}
633637

634638
foreach ($container->getParameter('kernel.bundles') as $bundle) {
635639
$reflection = new \ReflectionClass($bundle);

‎src/Symfony/Bundle/TwigBundle/TwigEngine.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/TwigEngine.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public function guessDefaultEscapingStrategy($filename)
5757
if ('js' === $format) {
5858
return 'js';
5959
}
60+
61+
if ('txt' === $format) {
62+
return false;
63+
}
6064

6165
return 'html';
6266
}

‎src/Symfony/Component/EventDispatcher/Tests/EventTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/Tests/EventTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function setUp()
4646
protected function tearDown()
4747
{
4848
$this->event = null;
49-
$this->eventDispatcher = null;
49+
$this->dispatcher = null;
5050
}
5151

5252
public function testIsPropagationStopped()

‎src/Symfony/Component/Form/Extension/Core/Type/DateType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/DateType.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ private function listYears(array $years)
279279
$result = array();
280280

281281
foreach ($years as $year) {
282-
$result[$year] = gmmktime(0, 0, 0, 6, 15, $year);
282+
if (false !== $y = gmmktime(0, 0, 0, 6, 15, $year)) {
283+
$result[$year] = $y;
284+
}
283285
}
284286

285287
return $result;

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,4 +778,25 @@ public function testDayErrorsBubbleUp($widget)
778778
$this->assertSame(array(), $form['day']->getErrors());
779779
$this->assertSame(array($error), $form->getErrors());
780780
}
781+
782+
public function testYearsFor32BitsMachines()
783+
{
784+
if (4 !== PHP_INT_SIZE) {
785+
$this->markTestSkipped(
786+
'PHP must be compiled in 32 bit mode to run this test');
787+
}
788+
789+
$form = $this->factory->create('date', null, array(
790+
'years' => range(1900, 2040),
791+
));
792+
793+
$view = $form->createView();
794+
795+
$listChoices = array();
796+
foreach(range(1902, 2037) as $y) {
797+
$listChoices[] = new ChoiceView($y, $y, $y);
798+
}
799+
800+
$this->assertEquals($listChoices, $view['year']->vars['choices']);
801+
}
781802
}

‎src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function start()
163163
*/
164164
public function getId()
165165
{
166-
if (!$this->started) {
166+
if (!$this->started && !$this->closed) {
167167
return ''; // returning empty is consistent with session_id() behaviour
168168
}
169169

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,12 @@ public function testGetId()
8585
{
8686
$storage = $this->getStorage();
8787
$this->assertEquals('', $storage->getId());
88+
8889
$storage->start();
8990
$this->assertNotEquals('', $storage->getId());
91+
92+
$storage->save();
93+
$this->assertNotEquals('', $storage->getId());
9094
}
9195

9296
public function testRegenerate()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.