[WebProfilerBundle] fix FC with HttpFoundation v5
This commit is contained in:
parent
a1d07a99cd
commit
1872a5af39
@ -140,9 +140,7 @@ class ProfilerController
|
|||||||
throw new NotFoundHttpException('The profiler must be enabled.');
|
throw new NotFoundHttpException('The profiler must be enabled.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$session = $request->getSession();
|
if ($request->hasSession() && ($session = $request->getSession()) && $session->isStarted() && $session->getFlashBag() instanceof AutoExpireFlashBag) {
|
||||||
|
|
||||||
if (null !== $session && $session->isStarted() && $session->getFlashBag() instanceof AutoExpireFlashBag) {
|
|
||||||
// keep current flashes for one more request if using AutoExpireFlashBag
|
// keep current flashes for one more request if using AutoExpireFlashBag
|
||||||
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll());
|
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll());
|
||||||
}
|
}
|
||||||
@ -199,7 +197,7 @@ class ProfilerController
|
|||||||
$this->cspHandler->disableCsp();
|
$this->cspHandler->disableCsp();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $session = $request->getSession()) {
|
if (!$request->hasSession()) {
|
||||||
$ip =
|
$ip =
|
||||||
$method =
|
$method =
|
||||||
$statusCode =
|
$statusCode =
|
||||||
@ -209,6 +207,8 @@ class ProfilerController
|
|||||||
$limit =
|
$limit =
|
||||||
$token = null;
|
$token = null;
|
||||||
} else {
|
} else {
|
||||||
|
$session = $request->getSession();
|
||||||
|
|
||||||
$ip = $request->query->get('ip', $session->get('_profiler_search_ip'));
|
$ip = $request->query->get('ip', $session->get('_profiler_search_ip'));
|
||||||
$method = $request->query->get('method', $session->get('_profiler_search_method'));
|
$method = $request->query->get('method', $session->get('_profiler_search_method'));
|
||||||
$statusCode = $request->query->get('status_code', $session->get('_profiler_search_status_code'));
|
$statusCode = $request->query->get('status_code', $session->get('_profiler_search_status_code'));
|
||||||
@ -308,7 +308,9 @@ class ProfilerController
|
|||||||
$limit = $request->query->get('limit');
|
$limit = $request->query->get('limit');
|
||||||
$token = $request->query->get('token');
|
$token = $request->query->get('token');
|
||||||
|
|
||||||
if (null !== $session = $request->getSession()) {
|
if ($request->hasSession()) {
|
||||||
|
$session = $request->getSession();
|
||||||
|
|
||||||
$session->set('_profiler_search_ip', $ip);
|
$session->set('_profiler_search_ip', $ip);
|
||||||
$session->set('_profiler_search_method', $method);
|
$session->set('_profiler_search_method', $method);
|
||||||
$session->set('_profiler_search_status_code', $statusCode);
|
$session->set('_profiler_search_status_code', $statusCode);
|
||||||
|
Reference in New Issue
Block a user