Преглед на файлове

Merge remote branch 'azogheb/webProfilerOptimization'

* azogheb/webProfilerOptimization:
  [WebProfilerBundle] Optimization to listener
Fabien Potencier преди 14 години
родител
ревизия
18e56409c6
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2 3
      src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php

+ 2 - 3
src/Symfony/Bundle/WebProfilerBundle/WebDebugToolbarListener.php

@@ -86,13 +86,12 @@ class WebDebugToolbarListener
             $substrFunction = 'substr';
             $substrFunction = 'substr';
         }
         }
 
 
-        $toolbar = "\n".str_replace("\n", '', $this->templating->render('WebProfilerBundle:Profiler:toolbar_js.html.twig', array('token' => $response->headers->get('X-Debug-Token'))))."\n";
         $content = $response->getContent();
         $content = $response->getContent();
 
 
         if (false !== $pos = $posrFunction($content, '</body>')) {
         if (false !== $pos = $posrFunction($content, '</body>')) {
+            $toolbar = "\n".str_replace("\n", '', $this->templating->render('WebProfilerBundle:Profiler:toolbar_js.html.twig', array('token' => $response->headers->get('X-Debug-Token'))))."\n";
             $content = $substrFunction($content, 0, $pos).$toolbar.$substrFunction($content, $pos);
             $content = $substrFunction($content, 0, $pos).$toolbar.$substrFunction($content, $pos);
+            $response->setContent($content);
         }
         }
-
-        $response->setContent($content);
     }
     }
 }
 }