8000 Merge branch '3.3' into 3.4 · symfony/symfony@8be06c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8be06c4

Browse files
Merge branch '3.3' into 3.4
* 3.3: [Profiler] Fix request_collector check in main layout Github template: Remove EOM 3.2 from branch suggestion [Security] Fix security.interactive_login event const doc block Update Container.php: Deprecated -> @deprecated allow phpdocumentor/reflection-docblock >=3.2.1 Avoid infinite loops when profiler data is malformed [FrameworkBundle] Warmup annotations for bundle-less controllers and entities [HttpFoundation] Generate safe fallback filename for wrongly encoded filename
2 parents 736f0d0 + 049785b commit 8be06c4

File tree

10 files changed

+36
-14
lines changed

10 files changed

+36
-14
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 3.4 or master / 2.7, 2.8, 3.2 or 3.3 <!-- see comment below -->
3+
| Branch? | 3.4 or master / 2.7, 2.8 or 3.3 <!-- see comment below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- don't forget updating src/**/CHANGELOG.md files -->
66
| BC breaks? | yes/no

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"phpdocumentor/reflection-docblock": "^3.0"
103103
},
104104
"conflict": {
105-
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0",
105+
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.1",
106106
"phpdocumentor/type-resolver": "<0.2.0",
107107
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
108108
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ public function load(array $configs, ContainerBuilder $container)
259259
}
260260

261261
$this->addAnnotatedClassesToCompile(array(
262-
'**Bundle\\Controller\\',
263-
'**Bundle\\Entity\\',
262+
'**\\Controller\\',
263+
'**\\Entity\\',
264264

265265
// Added explicitly so that we don't rely on the class map being dumped to make it work
266266
'Symfony\\Bundle\\FrameworkBundle\\Contro D7E7 ller\\Controller',

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</h2>
2121

2222
{% set request_collector = profile.collectors.request|default(false) %}
23-
{% if request_collector is defined and request_collector.redirect -%}
23+
{% if request_collector and request_collector.redirect -%}
2424
{%- set redirect = request_collector.redirect -%}
2525
{%- set controller = redirect.controller -%}
2626
{%- set redirect_route = '@' ~ redirect.route %}

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function isCompiled()
111111
/**
112112
* Returns true if the container parameter bag are frozen.
113113
*
114-
* Deprecated since 3.3, to be removed in 4.0.
114+
* @deprecated since version 3.3, to be removed in 4.0.
115115
*
116116
* @return bool true if the container parameter bag are frozen, false otherwise
117117
*/

src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function setAutoEtag()
150150
* Sets the Content-Disposition header with the given filename.
151151
*
152152
* @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
153-
* @param string $filename Optionally use this filename instead of the real name of the file
153+
* @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file
154154
* @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
155155
*
156156
* @return $this
@@ -162,7 +162,7 @@ public function setContentDisposition($disposition, $filename = '', $filenameFal
162162
}
163163

164164
if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || false !== strpos($filename, '%'))) {
165-
$encoding = mb_detect_encoding($filename, null, true);
165+
$encoding = mb_detect_encoding($filename, null, true) ?: '8bit';
166166

167167
for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) {
168168
$char = mb_substr($filename, $i, 1, $encoding);

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ public function testSetContentDispositionGeneratesSafeFallbackFilename()
6969
$this->assertSame('attachment; filename="f__.html"; filename*=utf-8\'\'f%C3%B6%C3%B6.html', $response->headers->get('Content-Disposition'));
7070
}
7171

72+
public function testSetContentDispositionGeneratesSafeFallbackFilenameForWronglyEncodedFilename()
73+
{
74+
$response = new BinaryFileResponse(__FILE__);
75+
76+
$iso88591EncodedFilename = utf8_decode('föö.html');
77+
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $iso88591EncodedFilename);
78+
79+
// the parameter filename* is invalid in this case (rawurldecode('f%F6%F6') does not provide a UTF-8 string but an ISO-8859-1 encoded one)
80+
$this->assertSame('attachment; filename="f__.html"; filename*=utf-8\'\'f%F6%F6.html', $response->headers->get('Content-Disposition'));
81+
}
82+
7283
/**
7384
* @dataProvider provideRanges
7485
*/

src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,19 @@ public function write(Profile $profile)
142142
}
143143
}
144144

145+
$profileToken = $profile->getToken();
146+
// when there are errors in sub-requests, the parent and/or children tokens
147+
// may equal the profile token, resulting in infinite loops
148+
$parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null;
149+
$childrenToken = array_filter(array_map(function ($p) use ($profileToken) {
150+
return $profileToken !== $p->getToken() ? $p->getToken() : null;
151+
}, $profile->getChildren()));
152+
145153
// Store profile
146154
$data = array(
147-
'token' => $profile->getToken(),
148-
'parent' => $profile->getParentToken(),
149-
'children' => array_map(function ($p) { return $p->getToken(); }, $profile->getChildren()),
155+
'token' => $profileToken,
156+
'parent' => $parentToken,
157+
'children' => $childrenToken,
150158
'data' => $profile->getCollectors(),
151159
'ip' => $profile->getIp(),
152160
'method' => $profile->getMethod(),

src/Symfony/Component/PropertyInfo/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"doctrine/annotations": "~1.0"
3535
},
3636
"conflict": {
37-
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0",
37+
"phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.1",
3838
"phpdocumentor/type-resolver": "<0.2.0",
3939
"symfony/dependency-injection": "<3.3"
4040
},

src/Symfony/Component/Security/Http/SecurityEvents.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
final class SecurityEvents
1515
{
1616
/**
17-
* The INTERACTIVE_LOGIN event occurs after a user is logged in
18-
* interactively for authentication based on http, cookies or X509.
17+
* The INTERACTIVE_LOGIN event occurs after a user has actively logged
18+
* into your website. It is important to distinguish this action from
19+
* non-interactive authentication methods, such as:
20+
* - authentication based on your session.
21+
* - authentication using a HTTP basic or HTTP digest header.
1922
*
2023
* @Event("Symfony\Component\Security\Http\Event\InteractiveLoginEvent")
2124
*

0 commit comments

Comments
 (0)
0