@@ -99,16 +99,20 @@ public function panelAction(Request $request, $token)
9999 throw new NotFoundHttpException (sprintf ('Panel "%s" is not available for token "%s". ' , $ panel , $ token ));
100100 }
101101
102- return new Response ($ this ->twig ->render ($ this ->getTemplateManager ()->getName ($ profile , $ panel ), array (
103- 'token ' => $ token ,
104- 'profile ' => $ profile ,
105- 'collector ' => $ profile ->getCollector ($ panel ),
106- 'panel ' => $ panel ,
107- 'page ' => $ page ,
108- 'request ' => $ request ,
109- 'templates ' => $ this ->getTemplateManager ()->getTemplates ($ profile ),
110- 'is_ajax ' => $ request ->isXmlHttpRequest (),
111- )), 200 , array ('Content-Type ' => 'text/html ' ));
102+ return Response::create (
103+ $ this ->twig ->render ($ this ->getTemplateManager ()->getName ($ profile , $ panel ), array (
104+ 'token ' => $ token ,
105+ 'profile ' => $ profile ,
106+ 'collector ' => $ profile ->getCollector ($ panel ),
107+ 'panel ' => $ panel ,
108+ 'page ' => $ page ,
109+ 'request ' => $ request ,
110+ 'templates ' => $ this ->getTemplateManager ()->getTemplates ($ profile ),
111+ 'is_ajax ' => $ request ->isXmlHttpRequest (),
112+ )),
113+ 200 ,
114+ array ('Content-Type ' => 'text/html ' )
115+ )->setCharset ('UTF-8 ' );
112116 }
113117
114118 /**
@@ -147,9 +151,13 @@ public function infoAction($about)
147151
148152 $ this ->profiler ->disable ();
149153
150- return new Response ($ this ->twig ->render ('@WebProfiler/Profiler/info.html.twig ' , array (
151- 'about ' => $ about ,
152- )), 200 , array ('Content-Type ' => 'text/html ' ));
154+ return Response::create (
155+ $ this ->twig ->render ('@WebProfiler/Profiler/info.html.twig ' , array (
156+ 'about ' => $ about ,
157+ )),
158+ 200 ,
159+ array ('Content-Type ' => 'text/html ' )
160+ )->setCharset ('UTF-8 ' );
153161 }
154162
155163 /**
@@ -197,13 +205,17 @@ public function toolbarAction(Request $request, $token)
197205 // the profiler is not enabled
198206 }
199207
200- return new Response ($ this ->twig ->render ('@WebProfiler/Profiler/toolbar.html.twig ' , array (
201- 'position ' => $ position ,
202- 'profile ' => $ profile ,
203- 'templates ' => $ this ->getTemplateManager ()->getTemplates ($ profile ),
204- 'profiler_url ' => $ url ,
205- 'token ' => $ token ,
206- )), 200 , array ('Content-Type ' => 'text/html ' ));
208+ return Response::create (
209+ $ this ->twig ->render ('@WebProfiler/Profiler/toolbar.html.twig ' , array (
210+ 'position ' => $ position ,
211+ 'profile ' => $ profile ,
212+ 'templates ' => $ this ->getTemplateManager ()->getTemplates ($ profile ),
213+ 'profiler_url ' => $ url ,
214+ 'token ' => $ token ,
215+ )),
216+ 200 ,
217+ array ('Content-Type ' => 'text/html ' )
218+ )->setCharset ('UTF-8 ' );
207219 }
208220
209221 /**
@@ -241,15 +253,19 @@ public function searchBarAction(Request $request)
241253 $ token = $ session ->get ('_profiler_search_token ' );
242254 }
243255
244- return new Response ($ this ->twig ->render ('@WebProfiler/Profiler/search.html.twig ' , array (
245- 'token ' => $ token ,
246- 'ip ' => $ ip ,
247- 'method ' => $ method ,
248- 'url ' => $ url ,
249- 'start ' => $ start ,
250- 'end ' => $ end ,
251- 'limit ' => $ limit ,
252- )), 200 , array ('Content-Type ' => 'text/html ' ));
256+ return Response::create (
257+ $ this ->twig ->render ('@WebProfiler/Profiler/search.html.twig ' , array (
258+ 'token ' => $ token ,
259+ 'ip ' => $ ip ,
260+ 'method ' => $ method ,
261+ 'url ' => $ url ,
262+ 'start ' => $ start ,
263+ 'end ' => $ end ,
264+ 'limit ' => $ limit ,
265+ )),
266+ 200 ,
267+ array ('Content-Type ' => 'text/html ' )
268+ )->setCharset ('UTF-8 ' );
253269 }
254270
255271 /**
@@ -279,18 +295,22 @@ public function searchResultsAction(Request $request, $token)
279295 $ end = $ request ->query ->get ('end ' , null );
280296 $ limit = $ request ->query ->get ('limit ' );
281297
282- return new Response ($ this ->twig ->render ('@WebProfiler/Profiler/results.html.twig ' , array (
283- 'token ' => $ token ,
284- 'profile ' => $ profile ,
285- 'tokens ' => $ this ->profiler ->find ($ ip , $ url , $ limit , $ method , $ start , $ end ),
286- 'ip ' => $ ip ,
287- 'method ' => $ method ,
288- 'url ' => $ url ,
289- 'start ' => $ start ,
290- 'end ' => $ end ,
291- 'limit ' => $ limit ,
292- 'panel ' => null ,
293- )), 200 , array ('Content-Type ' => 'text/html ' ));
298+ return Response::create (
299+ $ this ->twig ->render ('@WebProfiler/Profiler/results.html.twig ' , array (
300+ 'token ' => $ token ,
301+ 'profile ' => $ profile ,
302+ 'tokens ' => $ this ->profiler ->find ($ ip , $ url , $ limit , $ method , $ start , $ end ),
303+ 'ip ' => $ ip ,
304+ 'method ' => $ method ,
305+ 'url ' => $ url ,
306+ 'start ' => $ start ,
307+ 'end ' => $ end ,
308+ 'limit ' => $ limit ,
309+ 'panel ' => null ,
310+ )),
311+ 200 ,
312+ array ('Content-Type ' => 'text/html ' )
313+ )->setCharset ('UTF-8 ' );
294314 }
295315
296316 /**
@@ -364,7 +384,7 @@ public function phpinfoAction()
364384 phpinfo ();
365385 $ phpinfo = ob_get_clean ();
366386
367- return new Response ($ phpinfo , 200 , array ('Content-Type ' => 'text/html ' ));
387+ return Response:: create ($ phpinfo , 200 , array ('Content-Type ' => 'text/html ' ))-> setCharset ( ' UTF-8 ' );
368388 }
369389
370390 /**
0 commit comments