Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler.

This commit is contained in:
martijn 2019-05-01 18:49:52 +02:00 committed by Martijn Hartlief
parent 15e9eec225
commit 13ee1fa2b7
2 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ class ProfilerController
$url = null;
try {
$url = $this->generator->generate('_profiler', ['token' => $token]);
$url = $this->generator->generate('_profiler', ['token' => $token], UrlGeneratorInterface::ABSOLUTE_URL);
} catch (\Exception $e) {
// the profiler is not enabled
}

View File

@ -1,5 +1,5 @@
<div class="sf-toolbar-block sf-toolbar-block-{{ name }} sf-toolbar-status-{{ status|default('normal') }} {{ additional_classes|default('') }}" {{ block_attrs|default('')|raw }}>
{% if link is not defined or link %}<a href="{{ path('_profiler', { token: token, panel: name }) }}">{% endif %}
{% if link is not defined or link %}<a href="{{ url('_profiler', { token: token, panel: name }) }}">{% endif %}
<div class="sf-toolbar-icon">{{ icon|default('') }}</div>
{% if link|default(false) %}</a>{% endif %}
<div class="sf-toolbar-info">{{ text|default('') }}</div>