Skip to content

Commit 9e14f9f

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: bumped Symfony version to 2.7.12 updated VERSION for 2.7.11 updated CHANGELOG for 2.7.11 [Request] Fix support of custom mime types with parameters fix mocks fix mocks [Validator] do not treat payload as callback
2 parents 56fa798 + 3c1738a commit 9e14f9f

File tree

6 files changed

+63
-5
lines changed

6 files changed

+63
-5
lines changed

CHANGELOG-2.7.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,53 @@ in 2.7 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1
99

10+
* 2.7.11 (2016-03-25)
11+
12+
* bug #18255 [HttpFoundation] Fix support of custom mime types with parameters (Ener-Getick)
13+
* bug #18272 [Bridge\PhpUnit] Workaround old phpunit bug, no colors in weak mode, add tests (nicolas-grekas)
14+
* bug #18259 [PropertyAccess] Backport fixes from 2.7 (nicolas-grekas)
15+
* bug #18261 [PropertyAccess] Fix isPropertyWritable not using the reflection cache (nicolas-grekas)
16+
* bug #18224 [PropertyAccess] Remove most ref mismatches to improve perf (nicolas-grekas)
17+
* bug #18210 [PropertyAccess] Throw an UnexpectedTypeException when the type do not match (dunglas, nicolas-grekas)
18+
* bug #18216 [Intl] Fix invalid numeric literal on PHP 7 (nicolas-grekas)
19+
* bug #18147 [Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols (natechicago)
20+
* bug #18023 [Process] getIncrementalOutput should work without calling getOutput (romainneutron)
21+
* bug #18175 [Translation] Add support for fuzzy tags in PoFileLoader (nud)
22+
* bug #18179 [Form] Fix NumberToLocalizedStringTransformer::reverseTransform with big integers (ovrflo, nicolas-grekas)
23+
* bug #18164 [HttpKernel] set s-maxage only if all responses are cacheable (xabbuh)
24+
* bug #18150 [Process] Wait a bit less on Windows (nicolas-grekas)
25+
* bug #18130 [Debug] Replaced logic for detecting filesystem case sensitivity (Dan Blows)
26+
* bug #18080 [HttpFoundation] Set the Content-Range header if the requested Range is unsatisfied (jakzal)
27+
* bug #18084 [HttpFoundation] Avoid warnings when checking malicious IPs (jakzal)
28+
* bug #18066 [Process] Fix pipes handling (nicolas-grekas)
29+
* bug #18078 [Console] Fix an autocompletion question helper issue with non-sequentially indexed choices (jakzal)
30+
* bug #18048 [HttpKernel] Fix mem usage when stripping the prod container (nicolas-grekas)
31+
* bug #18065 [Finder] Partially revert #17134 to fix a regression (jakzal)
32+
* bug #18018 [HttpFoundation] exception when registering bags for started sessions (xabbuh)
33+
* bug #18054 [Filesystem] Fix false positive in ->remove() (nicolas-grekas)
34+
* bug #18049 [Validator] Fix the locale validator so it treats a locale alias as a valid locale (jakzal)
35+
* bug #18019 [Intl] Update ICU to version 55 (jakzal)
36+
* bug #18015 [Process] Fix memory issue when using large input streams (romainneutron)
37+
* bug #16656 [HttpFoundation] automatically generate safe fallback filename (xabbuh)
38+
* bug #15794 [Console] default to stderr in the console helpers (alcohol)
39+
* bug #17984 Allow to normalize \Traversable when serializing xml (Ener-Getick)
40+
* bug #17434 Improved the error message when a template is not found (rvanginneken, javiereguiluz)
41+
* bug #17687 Improved the error message when using "@" in a decorated service (javiereguiluz)
42+
* bug #17744 Improve error reporting in router panel of web profiler (javiereguiluz)
43+
* bug #17894 [FrameworkBundle] Fix a regression in handling absolute template paths (jakzal)
44+
* bug #17990 [DoctrineBridge][Form] Fix performance regression in EntityType (kimlai)
45+
* bug #17595 [HttpKernel] Remove _path from query parameters when fragment is a subrequest (cmenning)
46+
* bug #17986 [DomCrawler] Dont use LIBXML_PARSEHUGE by default (nicolas-grekas)
47+
* bug #17668 add 'guid' to list of exception to filter out (garak)
48+
* bug #17615 Ensure backend slashes for symlinks on Windows systems (cpsitgmbh)
49+
* bug #17626 Try to delete broken symlinks (IchHabRecht)
50+
* bug #17978 [Yaml] ensure dump indentation to be greather than zero (xabbuh)
51+
* bug #16886 [Form] [ChoiceType] Prefer placeholder to empty_value (boite)
52+
* bug #17976 [WebProfilerBundle] fix debug toolbar rendering by removing inadvertently added links (craue)
53+
* bug #17971 Variadic controller params (NiR-, fabpot)
54+
* bug #17568 Improved Bootstrap form theme for hidden fields (javiereguiluz)
55+
* bug #17925 [Bridge] The WebProcessor now forwards the client IP (magnetik)
56+
1057
* 2.7.10 (2016-02-28)
1158

1259
* bug #17947 Fix - #17676 (backport #17919 to 2.3) (Ocramius)

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,8 +1343,9 @@ public function getMimeType($format)
13431343
*/
13441344
public function getFormat($mimeType)
13451345
{
1346+
$canonicalMimeType = null;
13461347
if (false !== $pos = strpos($mimeType, ';')) {
1347-
$mimeType = substr($mimeType, 0, $pos);
1348+
$canonicalMimeType = substr($mimeType, 0, $pos);
13481349
}
13491350

13501351
if (null === static::$formats) {
@@ -1355,6 +1356,9 @@ public function getFormat($mimeType)
13551356
if (in_array($mimeType, (array) $mimeTypes)) {
13561357
return $format;
13571358
}
1359+
if (null !== $canonicalMimeType && in_array($canonicalMimeType, (array) $mimeTypes)) {
1360+
return $format;
1361+
}
13581362
}
13591363
}
13601364

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,13 @@ public function testGetMimeTypeFromFormat($format, $mimeTypes)
325325
}
326326
}
327327

328+
public function testGetFormatWithCustomMimeType()
329+
{
330+
$request = new Request();
331+
$request->setFormat('custom', 'application/vnd.foo.api;myversion=2.3');
332+
$this->assertEquals('custom', $request->getFormat('application/vnd.foo.api;myversion=2.3'));
333+
}
334+
328335
public function getFormatToMimeTypeMapProvider()
329336
{
330337
return array(

src/Symfony/Component/Validator/Constraints/Callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($options = null)
4949
@trigger_error('The "methods" option of the '.__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use the "callback" option instead.', E_USER_DEPRECATED);
5050
}
5151

52-
if (is_array($options) && !isset($options['callback']) && !isset($options['methods']) && !isset($options['groups'])) {
52+
if (is_array($options) && !isset($options['callback']) && !isset($options['methods']) && !isset($options['groups']) && !isset($options['payload'])) {
5353
if (is_callable($options) || !$options) {
5454
$options = array('callback' => $options);
5555
} else {

src/Symfony/Component/Validator/Tests/Fixtures/Entity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getData()
8585
}
8686

8787
/**
88-
* @Assert\Callback
88+
* @Assert\Callback(payload="foo")
8989
*/
9090
public function validateMe(ExecutionContextInterface $context)
9191
{

src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testLoadClassMetadata()
5353
$expected->setGroupSequence(array('Foo', 'Entity'));
5454
$expected->addConstraint(new ConstraintA());
5555
$expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
56-
$expected->addConstraint(new Callback('validateMe'));
56+
$expected->addConstraint(new Callback(array('callback' => 'validateMe', 'payload' => 'foo')));
5757
$expected->addConstraint(new Callback('validateMeStatic'));
5858
$expected->addPropertyConstraint('firstName', new NotNull());
5959
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));
@@ -123,7 +123,7 @@ public function testLoadClassMetadataAndMerge()
123123
$expected->setGroupSequence(array('Foo', 'Entity'));
124124
$expected->addConstraint(new ConstraintA());
125125
$expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback')));
126-
$expected->addConstraint(new Callback('validateMe'));
126+
$expected->addConstraint(new Callback(array('callback' => 'validateMe', 'payload' => 'foo')));
127127
$expected->addConstraint(new Callback('validateMeStatic'));
128128
$expected->addPropertyConstraint('firstName', new NotNull());
129129
$expected->addPropertyConstraint('firstName', new Range(array('min' => 3)));

0 commit comments

Comments
 (0)