Skip to content
Permalink
Browse files

bug #31349 [WebProfilerBundle] Use absolute URL for profiler links (A…

…lumbrados)

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.
  • Loading branch information...
nicolas-grekas committed May 22, 2019
2 parents f93e252 + 13ee1fa commit 8a220d8225efd0e8166272df9e0cc135a01c4d59
@@ -164,7 +164,7 @@ public function toolbarAction(Request $request, $token)
$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
}
@@ -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>

0 comments on commit 8a220d8

Please sign in to comment.
You can’t perform that action at this time.