[WebProfilerBundle] Set debug+charset on the ExceptionHandler fallback
This commit is contained in:
parent
cbd0525f8f
commit
ef410597a6
@ -55,7 +55,7 @@ class ExceptionController
|
|||||||
$template = $this->getTemplate();
|
$template = $this->getTemplate();
|
||||||
|
|
||||||
if (!$this->twig->getLoader()->exists($template)) {
|
if (!$this->twig->getLoader()->exists($template)) {
|
||||||
$handler = new ExceptionHandler();
|
$handler = new ExceptionHandler($this->debug, $this->twig->getCharset());
|
||||||
|
|
||||||
return new Response($handler->getContent($exception), 200, array('Content-Type' => 'text/html'));
|
return new Response($handler->getContent($exception), 200, array('Content-Type' => 'text/html'));
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ class ExceptionController
|
|||||||
$template = $this->getTemplate();
|
$template = $this->getTemplate();
|
||||||
|
|
||||||
if (!$this->templateExists($template)) {
|
if (!$this->templateExists($template)) {
|
||||||
$handler = new ExceptionHandler();
|
$handler = new ExceptionHandler($this->debug, $this->twig->getCharset());
|
||||||
|
|
||||||
return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
|
return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css'));
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ class ExceptionHandler
|
|||||||
foreach ($exception->getHeaders() as $name => $value) {
|
foreach ($exception->getHeaders() as $name => $value) {
|
||||||
header($name.': '.$value, false);
|
header($name.': '.$value, false);
|
||||||
}
|
}
|
||||||
|
header('Content-Type: text/html; charset='.$this->charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
|
echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
|
||||||
@ -110,7 +111,7 @@ class ExceptionHandler
|
|||||||
$exception = FlattenException::create($exception);
|
$exception = FlattenException::create($exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders());
|
return Response::create($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders())->setCharset($this->charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user