Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lupus_decoupled
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
lupus_decoupled
Commits
2d7ecf0d
Commit
2d7ecf0d
authored
2 months ago
by
Kul Pratap Singh
Committed by
Lio Novelli
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3488658
by kul.pratap, useernamee: phpstan pipeline is failing
parent
1c845929
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!111
Issue #3488658: Fix redirect URL initialization and ensure proper response handling.
Pipeline
#353012
passed
2 months ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/lupus_decoupled_ce_api/src/EventSubscriber/FrontendRedirectSubscriber.php
+13
-9
13 additions, 9 deletions
...ce_api/src/EventSubscriber/FrontendRedirectSubscriber.php
with
13 additions
and
9 deletions
modules/lupus_decoupled_ce_api/src/EventSubscriber/FrontendRedirectSubscriber.php
+
13
−
9
View file @
2d7ecf0d
...
...
@@ -80,6 +80,7 @@ class FrontendRedirectSubscriber implements EventSubscriberInterface {
if
(
in_array
(
$this
->
getCurrentRouteMatch
()
->
getRouteName
(),
$this
->
frontendRoutes
)
&&
(
$event
->
getRequest
()
->
getMethod
())
!=
'POST'
)
{
$route_match
=
$this
->
getCurrentRouteMatch
();
$redirect_url
=
NULL
;
// For entity routes, get entity-specific frontend base URLs.
if
(
preg_match
(
'/entity\.[a-z]+\.canonical/'
,
$route_match
->
getRouteName
()))
{
$parameters
=
$route_match
->
getParameters
()
->
all
();
...
...
@@ -101,16 +102,19 @@ class FrontendRedirectSubscriber implements EventSubscriberInterface {
}
}
// Prevent Core's RedirectResponseSubscriber from redirecting back to the
// original request's destination, ignoring our response.
$request_query_parameters
=
$this
->
requestStack
->
getCurrentRequest
()
->
query
;
$destination
=
$request_query_parameters
->
get
(
'destination'
);
if
(
$destination
)
{
$request_query_parameters
->
remove
(
'destination'
);
}
if
(
isset
(
$redirect_url
))
{
// Prevent Core's RedirectResponseSubscriber from redirecting back
// to the original request's destination, ignoring our response.
$request_query_parameters
=
$this
->
requestStack
->
getCurrentRequest
()
->
query
;
$destination
=
$request_query_parameters
->
get
(
'destination'
);
if
(
$destination
)
{
$request_query_parameters
->
remove
(
'destination'
);
}
$event
->
setResponse
(
new
TrustedRedirectResponse
(
$redirect_url
));
$event
->
stopPropagation
();
// Set the redirect response.
$event
->
setResponse
(
new
TrustedRedirectResponse
(
$redirect_url
));
$event
->
stopPropagation
();
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment