Skip to content

Commit 3fc89bc

Browse files
author
Craig Menning
committed
Remove _path from query parameters when fragment is a subrequest and request attributes are already set
1 parent 2c43532 commit 3fc89bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ public function onKernelRequest(GetResponseEvent $event)
5858
{
5959
$request = $event->getRequest();
6060

61-
if ($request->attributes->has('_controller') || $this->fragmentPath !== rawurldecode($request->getPathInfo())) {
61+
if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) {
62+
return;
63+
}
64+
65+
if ($request->attributes->has('_controller')) {
66+
// Is a sub-request: no need to parse _path but it should still be removed from query parameters as below.
67+
$request->query->remove('_path');
68+
6269
return;
6370
}
6471

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy