From 24c5ba4df343beb7cad299f49f78ce122a95f49a Mon Sep 17 00:00:00 2001 From: Vyacheslav Salakhutdinov Date: Thu, 11 Sep 2014 15:55:28 +0000 Subject: [PATCH] Use request format from request in twig ExceptionController --- .../Bundle/TwigBundle/Controller/ExceptionController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index 9557fb4aba..54ccbb03e0 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -39,20 +39,19 @@ class ExceptionController * @param Request $request The request * @param FlattenException $exception A FlattenException instance * @param DebugLoggerInterface $logger A DebugLoggerInterface instance - * @param string $_format The format to use for rendering (html, xml, ...) * * @return Response * * @throws \InvalidArgumentException When the exception template does not exist */ - public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null, $_format = 'html') + public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null) { $currentContent = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1)); $code = $exception->getStatusCode(); return new Response($this->twig->render( - $this->findTemplate($request, $_format, $code, $this->debug), + $this->findTemplate($request, $request->getRequestFormat(), $code, $this->debug), array( 'status_code' => $code, 'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',