From 6f841f184e4cb4cf82c2138dbc69aab81f298c20 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Fri, 22 Sep 2023 13:07:57 +0200 Subject: [PATCH] fix: make webprofiler links absolute path --- .../Resources/views/Profiler/base_js.html.twig | 4 ++-- .../Resources/views/Profiler/toolbar_item.html.twig | 2 +- .../Resources/views/Profiler/toolbar_js.html.twig | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index af36bc03313de..94365410ee305 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -537,7 +537,7 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { this.load( 'sfwdt' + token, - '{{ url("_wdt", { "token": "xxxxxx" })|escape('js') }}'.replace(/xxxxxx/, newToken), + '{{ path("_wdt", { "token": "xxxxxx" })|escape('js') }}'.replace(/xxxxxx/, newToken), function(xhr, el) { /* Do nothing in the edge case where the toolbar has already been replaced with a new one */ if (!document.getElementById('sfToolbarMainContent-' + newToken)) { @@ -618,7 +618,7 @@ if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') { sfwdt.innerHTML = '\
\
\ - An error occurred while loading the web debug toolbar. Open the web profiler.\ + An error occurred while loading the web debug toolbar. Open the web profiler.\
\ '; sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar'); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index d81e877977667..69872418cfb21 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,5 +1,5 @@
- {% if link is not defined or link %}{% endif %} + {% if link is not defined or link %}{% endif %}
{{ icon|default('') }}
{% if link|default(false) %}
{% endif %}
{{ text|default('') }}
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig index 352fbb0ea4c59..bdcf7db53bfd3 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig @@ -4,7 +4,7 @@ 'request': '@WebProfiler/Profiler/cancel.html.twig' }, profile: null, - profiler_url: url('_profiler', {token: token}), + profiler_url: path('_profiler', {token: token}), profiler_markup_version: 2, } %}