Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ef41059

Browse filesBrowse files
[WebProfilerBundle] Set debug+charset on the ExceptionHandler fallback
1 parent cbd0525 commit ef41059
Copy full SHA for ef41059

File tree

Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function showAction($token)
5555
$template = $this->getTemplate();
5656

5757
if (!$this->twig->getLoader()->exists($template)) {
58-
$handler = new ExceptionHandler();
58+
$handler = new ExceptionHandler($this->debug, $this->twig->getCharset());
5959

6060
return new Response($handler->getContent($exception), 200, array('Content-Type' => 'text/html'));
6161
}
@@ -95,7 +95,7 @@ public function cssAction($token)
9595
$template = $this->getTemplate();
9696

9797
if (!$this->templateExists($template)) {
98-
$handler = new ExceptionHandler();
98+
$handler = new ExceptionHandler($this->debug, $this->twig->getCharset());
9999

100100
return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
101101
}

‎src/Symfony/Component/Debug/ExceptionHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/ExceptionHandler.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function sendPhpResponse($exception)
9292
foreach ($exception->getHeaders() as $name => $value) {
9393
header($name.': '.$value, false);
9494
}
95+
header('Content-Type: text/html; charset='.$this->charset);
9596
}
9697

9798
echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
@@ -110,7 +111,7 @@ public function createResponse($exception)
110111
$exception = FlattenException::create($exception);
111112
}
112113

113-
return new Response($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders());
114+
return Response::create($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders())->setCharset($this->charset);
114115
}
115116

116117
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.