File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
libraries/src/Application
modules/mod_login/src/Helper Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -813,7 +813,7 @@ protected function route()
813813 new AfterRouteEvent ('onAfterRoute ' , ['subject ' => $ this ])
814814 );
815815
816- $ Itemid = $ this ->input ->getInt ('Itemid ' , null );
816+ $ Itemid = $ this ->input ->getInt ('Itemid ' , 0 );
817817 $ this ->authorise ($ Itemid );
818818 }
819819
Original file line number Diff line number Diff line change @@ -41,19 +41,23 @@ class LoginHelper
4141 */
4242 public function getReturnUrlString (Registry $ params , $ type , CMSApplicationInterface $ app ): string
4343 {
44- $ item = $ app ->getMenu ()->getItem ($ params ->get ($ type ));
45-
4644 // Stay on the same page
4745 $ url = Uri::getInstance ()->toString ();
4846
49- if ($ item ) {
50- $ lang = '' ;
47+ $ returnMenuId = $ params ->get ($ type , 0 );
5148
52- if ($ item ->language !== '* ' && Multilanguage::isEnabled ()) {
53- $ lang = '&lang= ' . $ item ->language ;
54- }
49+ if ($ returnMenuId > 0 ) {
50+ $ item = $ app ->getMenu ()->getItem ($ returnMenuId );
51+
52+ if ($ item ) {
53+ $ lang = '' ;
5554
56- $ url = 'index.php?Itemid= ' . $ item ->id . $ lang ;
55+ if ($ item ->language !== '* ' && Multilanguage::isEnabled ()) {
56+ $ lang = '&lang= ' . $ item ->language ;
57+ }
58+
59+ $ url = 'index.php?Itemid= ' . $ item ->id . $ lang ;
60+ }
5761 }
5862
5963 return base64_encode ($ url );
You can’t perform that action at this time.
0 commit comments