8000 bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (A… · symfony/symfony@8a220d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a220d8

Browse files
bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (Alumbrados)
This PR was merged into the 3.4 branch. Discussion ---------- [WebProfilerBundle] Use absolute URL for profiler links | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | n/a | Fixed tickets | n/a | License | MIT | Doc PR | n/a Generate absolute URL's so you can have a different (sub)domain for the profiler and the controller that uses it. Also uses the link which the controller generated instead of always generating a new link in Twig. The changes shouldn't inpact normal behavior. Commits ------- 13ee1fa Use absolute URL for when the profiler's domain differs from the controller's domain which initialises the profiler.
2 parents f93e252 + 13ee1fa commit 8a220d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function toolbarAction(Request $request, $token)
164164

165165
$url = null;
166166
try {
167-
$url = $this->generator->generate('_profiler', ['token' => $token]);
167+
$url = $this->generator->generate('_profiler', ['token' => $token], UrlGeneratorInterface::ABSOLUTE_URL);
168168
} catch (\Exception $e) {
169169
// the profiler is not enabled
170170
}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="sf-toolbar-block sf-toolbar-block-{{ name }} sf-toolbar-status-{{ status|default('normal') }} {{ additional_classes|default('') }}" {{ block_attrs|default('')|raw }}>
2-
{% if link is not defined or link %}<a href="{{ path('_profiler', { token: token, panel: name }) }}">{% endif %}
2+
{% if link is not defined or link %}<a href="{{ url('_profiler', { token: token, panel: name }) }}">{% endif %}
33
<div class="sf-toolbar-icon">{{ icon|default('') }}</div>
44
{% if link|default(false) %}</a>{% endif %}
55
<div class="sf-toolbar-info">{{ text|default('') }}</div>

0 commit comments

Comments
 (0)
0