Skip to content

Commit dd5b79e

Browse files
Merge branch '3.0' into 3.1
* 3.0: (25 commits) Fix merge [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 [Console] fixed PHPDoc [travis] HHVM 3.12 LTS Fix feature detection for IE [Form] Fixed collapsed choice attributes [Console] added explanation of messages usage in a progress bar force enabling the external XML entity loaders [Yaml] properly count skipped comment lines [WebProfilerBundle] Fix invalid CSS style Added progressive jpeg to mime types guesser [Yaml] Fix wrong line number when comments are inserted in the middle of a block. Fixed singular of committee Do not inject web debug toolbar on attachments bumped Symfony version to 3.0.8 updated VERSION for 3.0.7 updated CHANGELOG for 3.0.7 bumped Symfony version to 2.8.8 updated VERSION for 2.8.7 updated CHANGELOG for 2.8.7 ... Conflicts: src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyAccess/StringUtil.php src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2 parents 7821004 + 7903d24 commit dd5b79e

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

EventListener/WebDebugToolbarListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function onKernelResponse(FilterResponseEvent $event)
9898
|| $response->isRedirection()
9999
|| ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
100100
|| 'html' !== $request->getRequestFormat()
101+
|| false !== stripos($response->headers->get('Content-Disposition'), 'attachment;')
101102
) {
102103
return;
103104
}

Resources/views/Profiler/base_js.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
var addEventListener;
225225
226226
var el = document.createElement('div');
227-
if (!'addEventListener' in el) {
227+
if (!('addEventListener' in el)) {
228228
addEventListener = function (element, eventName, callback) {
229229
element.attachEvent('on' + eventName, callback);
230230
};

Resources/views/Router/panel.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<h3>Route Redirection</h3>
3131

3232
<p>This page redirects to:</p>
33-
<div class="card" style="break-long-words">
33+
<div class="card break-long-words">
3434
{{ router.targetUrl }}
3535
{% if router.targetRoute %}<span class="text-muted">(route: "{{ router.targetRoute }}")</span>{% endif %}
3636
</div>

Tests/EventListener/WebDebugToolbarListenerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@ public function testToolbarIsInjected()
8282
$this->assertEquals("<html><head></head><body>\nWDT\n</body></html>", $response->getContent());
8383
}
8484

85+
/**
86+
* @depends testToolbarIsInjected
87+
*/
88+
public function testToolbarIsNotInjectedOnContentDispositionAttachment()
89+
{
90+
$response = new Response('<html><head></head><body></body></html>');
91+
$response->headers->set('Content-Disposition', 'attachment; filename=test.html');
92+
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'html'), HttpKernelInterface::MASTER_REQUEST, $response);
93+
94+
$listener = new WebDebugToolbarListener($this->getTwigMock());
95+
$listener->onKernelResponse($event);
96+
97+
$this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
98+
}
99+
85100
/**
86101
* @depends testToolbarIsInjected
87102
* @dataProvider provideRedirects

0 commit comments

Comments
 (0)