Skip to content

Commit 7903d24

Browse files
Merge branch '2.8' into 3.0
* 2.8: (22 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 2.8.8 updated VERSION for 2.8.7 updated CHANGELOG for 2.8.7 bumped Symfony version to 2.7.15 updated VERSION for 2.7.14 update CONTRIBUTORS for 2.7.14 ... Conflicts: CHANGELOG-2.7.md CHANGELOG-3.0.md src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php src/Symfony/Component/HttpKernel/Kernel.php
2 parents 44ea150 + cba7892 commit 7903d24

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
@@ -211,7 +211,7 @@
211211
var addEventListener;
212212
213213
var el = document.createElement('div');
214-
if (!'addEventListener' in el) {
214+
if (!('addEventListener' in el)) {
215215
addEventListener = function (element, eventName, callback) {
216216
element.attachEvent('on' + eventName, callback);
217217
};

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)