Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05eb388

Browse files
Merge branch '3.4' into 4.2
* 3.4: Add a missing quote in getValue() DocBlock [HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor. minor: ChoiceType callable deprecation after/before seems wrong
2 parents 687f775 + 04c6c92 commit 05eb388

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

UPGRADE-4.0.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,19 +297,17 @@ Form
297297
`ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed.
298298

299299
* Using callable strings as choice options in ChoiceType is not supported
300-
anymore in favor of passing PropertyPath instances.
300+
anymore.
301301

302302
Before:
303303

304304
```php
305-
'choice_value' => new PropertyPath('range'),
306305
'choice_label' => 'strtoupper',
307306
```
308307

309308
After:
310309

311310
```php
312-
'choice_value' => 'range',
313311
'choice_label' => function ($choice) {
314312
return strtoupper($choice);
315313
},

src/Symfony/Component/HttpFoundation/RedirectResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(?string $url, int $status = 302, array $headers = []
4242
throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status));
4343
}
4444

45-
if (301 == $status && !\array_key_exists('cache-control', $headers)) {
45+
if (301 == $status && !\array_key_exists('cache-control', array_change_key_case($headers, \CASE_LOWER))) {
4646
$this->headers->remove('cache-control');
4747
}
4848
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public function testCacheHeaders()
9191
$this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
9292
$this->assertTrue($response->headers->hasCacheControlDirective('max-age'));
9393

94+
$response = new RedirectResponse('foo.bar', 301, ['Cache-Control' => 'max-age=86400']);
95+
$this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
96+
$this->assertTrue($response->headers->hasCacheControlDirective('max-age'));
97+
9498
$response = new RedirectResponse('foo.bar', 302);
9599
$this->assertTrue($response->headers->hasCacheControlDirective('no-cache'));
96100
}

src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function setValue(&$objectOrArray, $propertyPath, $value);
5858
*
5959
* $propertyAccessor = PropertyAccess::createPropertyAccessor();
6060
*
61-
* echo $propertyAccessor->getValue($object, 'child.name);
61+
* echo $propertyAccessor->getValue($object, 'child.name');
6262
* // equals echo $object->getChild()->getName();
6363
*
6464
* This method first tries to find a public getter for each property in the

0 commit comments

Comments
 (0)