Skip to content

Commit a226aa0

Browse files
committed
Merge branch '2.2'
* 2.2: Fix default value handling for multi-value options [HttpKernel] truncate profiler token to 6 chars (see #7665) Disabled APC on Travis for PHP 5.5+ as it is not available [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path Fix download over SSL using IE < 8 and binary file response [Console] Fix merging of application definition, fixes #7068, replaces #7158 [HttpKernel] fixed the Kernel when the ClassLoader component is not available (closes #7406) fixed output of bag values [Yaml] improved boolean naming ($notEOF -> !$EOF) [Yaml] fixed handling an empty value [Routing][XML Loader] Add a possibility to set a default value to null [Console] fixed handling of "0" input on ask The /e modifier for preg_replace() is deprecated in PHP 5.5; replace with preg_replace_callback() fixed handling of "0" input on ask [HttpFoundation] Fixed bug in key searching for NamespacedAttributeBag [Form] DateTimeToRfc3339Transformer use proper transformation exteption in reverse transformation Update PhpEngine.php [PropertyAccess] Add objectives to pluralMap [Security] Removed unused var [HttpFoundation] getClientIp is fixed. Conflicts: src/Symfony/Component/Console/Tests/Command/CommandTest.php src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php src/Symfony/Component/HttpFoundation/Request.php src/Symfony/Component/HttpKernel/Kernel.php
2 parents 4a1061c + 4ddb0fb commit a226aa0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public function reverseTransform($rfc3339)
5353
return null;
5454
}
5555

56-
$dateTime = new \DateTime($rfc3339);
56+
try {
57+
$dateTime = new \DateTime($rfc3339);
58+
} catch (\Exception $e) {
59+
throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e);
60+
}
5761

5862
if ($this->outputTimezone !== $this->inputTimezone) {
5963
try {

Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,14 @@ public function testReverseTransformWithNonExistingDate()
119119

120120
$transformer->reverseTransform('2010-04-31T04:05Z');
121121
}
122+
123+
/**
124+
* @expectedException Symfony\Component\Form\Exception\TransformationFailedException
125+
*/
126+
public function testReverseTransformExpectsValidDateString()
127+
{
128+
$transformer = new DateTimeToRfc3339Transformer('UTC', 'UTC');
129+
130+
$transformer->reverseTransform('2010-2010-2010');
131+
}
122132
}

0 commit comments

Comments
 (0)