8000 Merge remote branch 'azogheb/webProfilerOptimization' · jaimesuez/symfony@18e5640 · GitHub
[go: up one dir, main page]

Skip to content

Commit 18e5640

Browse files
committed
Merge remote branch 'azogheb/webProfilerOptimization'
* azogheb/webProfilerOptimization: [WebProfilerBundle] Optimization to listener
2 parents 9be419e + 80b282b commit 18e5640

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,12 @@ protected function injectToolbar(Response $response)
8686
$substrFunction = 'substr';
8787
}
8888

89-
$toolbar = "\n".str_replace("\n", '', $this->templating->render('WebProfilerBundle:Profiler:toolbar_js.html.twig', array('token' => $response->headers->get('X-Debug-Token'))))."\n";
9089
$content = $response->getContent();
9190

9291
if (false !== $pos = $posrFunction($content, '</body>')) {
92+
$toolbar = "\n".str_replace("\n", '', $this->templating->render('WebProfilerBundle:Profiler:toolbar_js.html.twig', array('token' => $response->headers->get('X-Debug-Token'))))."\n";
9393
$content = $substrFunction($content, 0, $pos).$toolbar.$substrFunction($content, $pos);
94+
$response->setContent($content);
9495
}
95-
96-
$response->setContent($content);
9796
}
9897
}

0 commit comments

Comments
 (0)
0