8000 Use request format from request in twig ExceptionController · symfony/symfony@24c5ba4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24c5ba4

Browse files
megazollfabpot
authored andcommitted
Use request format from request in twig ExceptionController
1 parent 6ad5d31 commit 24c5ba4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,19 @@ public function __construct(\Twig_Environment $twig, $debug)
3939
* @param Request $request The request
4040
* @param FlattenException $exception A FlattenException instance
4141
* @param DebugLoggerInterface $logger A DebugLoggerInterface instance
42-
* @param string $_format The format to use for rendering (html, xml, ...)
4342
*
4443
* @return Response
4544
*
4645
* @throws \InvalidArgumentException When the exception template does not exist
4746
*/
48-
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null, $_format = 'html')
47+
public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
4948
{
5049
$currentContent = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1));
5150

5251
$code = $exception->getStatusCode();
5352

5453
return new Response($this->twig->render(
55-
$this->findTemplate($request, $_format, $code, $this->debug),
54+
$this->findTemplate($request, $request->getRequestFormat(), $code, $this->debug),
5655
array(
5756
'status_code' => $code,
5857
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',

0 commit comments

Comments
 (0)
0