This repository was archived by the owner on Mar 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/system/UsersModule/Listener Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments