File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
modules/mod_login/src/Helper Expand file tree Collapse file tree 1 file changed +12
-8
lines changed 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