diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 96347eaf3a..491ca0b6ea 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -147,7 +147,7 @@ class ProfilerController extends ContainerAware { $request = $this->container->get('request'); - if (null !== $session = $request->getSession() && $session instanceof AutoExpireFlashBag) { + if (null !== $session = $request->getSession() && $session->getFlashBag() instanceof AutoExpireFlashBag) { // keep current flashes for one more request if using AutoExpireFlashBag $session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php index 9d615c9c5c..b9418e6b2a 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php +++ b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php @@ -72,7 +72,7 @@ class WebDebugToolbarListener if ($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects) { $session = $request->getSession(); - if ($session instanceof AutoExpireFlashBag) { + if ($session->getFlashBag() instanceof AutoExpireFlashBag) { // keep current flashes for one more request if using AutoExpireFlashBag $session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); }