@@ -99,16 +99,20 @@ public function panelAction(Request $request, $token)
99
99
throw new NotFoundHttpException (sprintf ('Panel "%s" is not available for token "%s". ' , $ panel , $ token ));
100
100
}
101
101
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 ' );
112
116
}
113
117
114
118
/**
@@ -147,9 +151,13 @@ public function infoAction($about)
147
151
148
152
$ this ->profiler ->disable ();
149
153
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 ' );
153
161
}
154
162
155
163
/**
@@ -197,13 +205,17 @@ public function toolbarAction(Request $request, $token)
197
205
// the profiler is not enabled
198
206
}
199
207
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 ' );
207
219
}
208
220
209
221
/**
@@ -241,15 +253,19 @@ public function searchBarAction(Request $request)
241
253
$ token = $ session ->get ('_profiler_search_token ' );
242
254
}
243
255
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 '
F987
; );
253
269
}
254
270
255
271
/**
@@ -279,18 +295,22 @@ public function searchResultsAction(Request $request, $token)
279
295
$ end = $ request ->query ->get ('end ' , null );
280
296
$ limit = $ request ->query ->get ('limit ' );
281
297
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 ' );
294
314
}
295
315
296
316
/**
@@ -364,7 +384,7 @@ public function phpinfoAction()
364
384
phpinfo ();
365
385
$ phpinfo = ob_get_clean ();
366
386
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 ' );
368
388
}
369
389
370
390
/**
0 commit comments