浏览代码

merged branch Seldaek/wdt (PR #1390)

Commits
-------

e272d56 [WebProfilerBundle] Fixes toolbar content check

Discussion
----------

[WebProfilerBundle] Fixes toolbar content check

It appears that some html optimizers trim the comments, therefore the old check was not working. This is more robust.

Fixes the issue reported in 8541a5bcbc97f965f4c53fc3ece790cdc4a922bf
Fabien Potencier 14 年之前
父节点
当前提交
73b22e5ad0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig

@@ -11,7 +11,7 @@
         xhr.open('GET', '{{ path("_wdt", { "token": token }) }}', true);
         xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
         xhr.onreadystatechange = function(state) {
-            if (4 === xhr.readyState && 200 === xhr.status && '<!-- START' === xhr.responseText.substring(0, 10)) {
+            if (4 === xhr.readyState && 200 === xhr.status && -1 !== xhr.responseText.indexOf('sf-toolbarreset')) {
                 wdt.innerHTML = xhr.responseText;
                 wdt.style.display = 'block';
             }