Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 16a73a6

Browse filesBrowse files
committed
fixup
1 parent f3458fb commit 16a73a6
Copy full SHA for 16a73a6

File tree

3 files changed

+5
-13
lines changed
Filter options

3 files changed

+5
-13
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\HttpFoundation\Request;
1818
use Symfony\Component\HttpFoundation\Response;
1919
use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag;
20-
use Symfony\Component\HttpFoundation\UrlHelper;
2120
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
2221
use Symfony\Component\HttpKernel\Event\ResponseEvent;
2322
use Symfony\Component\HttpKernel\KernelEvents;
@@ -48,9 +47,8 @@ class WebDebugToolbarListener implements EventSubscriberInterface
4847
private string $excludedAjaxPaths;
4948
private ?ContentSecurityPolicyHandler $cspHandler;
5049
private ?DumpDataCollector $dumpDataCollector;
51-
private ?UrlHelper $urlHelper;
5250

53-
public function __construct(Environment $twig, bool $interceptRedirects = false, int $mode = self::ENABLED, UrlGeneratorInterface $urlGenerator = null, string $excludedAjaxPaths = '^/bundles|^/_wdt', ContentSecurityPolicyHandler $cspHandler = null, DumpDataCollector $dumpDataCollector = null, UrlHelper $urlHelper = null)
51+
public function __construct(Environment $twig, bool $interceptRedirects = false, int $mode = self::ENABLED, UrlGeneratorInterface $urlGenerator = null, string $excludedAjaxPaths = '^/bundles|^/_wdt', ContentSecurityPolicyHandler $cspHandler = null, DumpDataCollector $dumpDataCollector = null)
5452
{
5553
$this->twig = $twig;
5654
$this->urlGenerator = $urlGenerator;
@@ -59,7 +57,6 @@ public function __construct(Environment $twig, bool $interceptRedirects = false,
5957
$this->excludedAjaxPaths = $excludedAjaxPaths;
6058
$this->cspHandler = $cspHandler;
6159
$this->dumpDataCollector = $dumpDataCollector;
62-
$this->urlHelper = $urlHelper;
6360
}
6461

6562
public function isEnabled(): bool
@@ -116,12 +113,7 @@ public function onKernelResponse(ResponseEvent $event): void
116113
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll());
117114
}
118115

119-
$location = $response->headers->get('Location');
120-
$response->setContent($this->twig->render('@WebProfiler/Profiler/toolbar_redirect.html.twig', [
121-
'location' => $location,
122-
'host' => $request->getSchemeAndHttpHost(),
123-
'absolute_url' => $this->urlHelper?->getAbsoluteUrl($location),
124-
]));
116+
$response->setContent($this->twig->render('@WebProfiler/Profiler/toolbar_redirect.html.twig', ['location' => $response->headers->get('Location'), 'host' => $request->getSchemeAndHttpHost()]));
125117
$response->setStatusCode(200);
126118
$response->headers->remove('Location');
127119
}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/config/toolbar.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
abstract_arg('paths that should be excluded from the AJAX requests shown in the toolbar'),
2626
service('web_profiler.csp.handler'),
2727
service('data_collector.dump')->ignoreOnInvalid(),
28-
service('url_helper')->ignoreOnInvalid(),
2928
])
3029
->tag('kernel.event_subscriber')
3130
;

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
<div class="block-exception">
4040
<h1>Redirection Intercepted</h1>
4141

42-
<p>This request redirects to <strong>{{ absolute_url ?? location }}</strong></p>
42+
{% set absolute_url = host in location ? location : absolute_url(location) %}
43+
<p>This request redirects to <strong>{{ absolute_url }}</strong></p>
4344

44-
<p><a class="btn" href="{{ absolute_url ?? location }}">Follow redirect</a></p>
45+
<p><a class="btn" href="{{ absolute_url }}">Follow redirect</a></p>
4546

4647
<p class="sf-redirection-help">
4748
The redirect was intercepted by the Symfony Web Debug toolbar to help debugging.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.