Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit ee958dd

Browse files
committed
backported forgotten change
1 parent c5d3392 commit ee958dd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/system/UsersModule/Listener/UserEventListener.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ public function setLocale(GenericEvent $event, $eventName)
6666
$locale = $userEntity->getLocale();
6767
if (!empty($locale)) {
6868
$url = $event->getArgument('returnUrl');
69-
$request = $this->requestStack->getCurrentRequest();
70-
$httpRoot = $request->getSchemeAndHttpHost() . $request->getBaseUrl();
71-
if (0 === strpos($url, $httpRoot)) {
72-
$url = str_replace($httpRoot, '', $url);
73-
}
74-
$pathInfo = $this->router->match($url);
75-
if ($pathInfo['_route']) {
76-
$event->setArgument('returnUrl', $this->router->generate($pathInfo['_route'], ['_locale' => $locale]));
69+
if ('' != $url) {
70+
$request = $this->requestStack->getCurrentRequest();
71+
$httpRoot = $request->getSchemeAndHttpHost() . $request->getBaseUrl();
72+
if (0 === strpos($url, $httpRoot)) {
73+
$url = str_replace($httpRoot, '', $url);
74+
}
75+
$pathInfo = $this->router->match($url);
76+
if ($pathInfo['_route']) {
77+
$event->setArgument('returnUrl', $this->router->generate($pathInfo['_route'], ['_locale' => $locale]));
78+
}
7779
}
7880
$this->session->set('_locale', $locale);
7981
}

0 commit comments

Comments
 (0)