* (bug 18799) Special:Userlogin now handles correctly the returnto parameter to not...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 25 Jul 2009 20:11:01 +0000 (20:11 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 25 Jul 2009 20:11:01 +0000 (20:11 +0000)
RELEASE-NOTES
includes/specials/SpecialUserlogin.php

index e3facec..9fafa8d 100644 (file)
@@ -333,6 +333,9 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 19301) Duplicates entries in $wgAddGroups, $wgRemoveGroups,
   $wgGroupsAddToSelf and $wgGroupsRemoveFromSelf are no more displayed on
   Special:ListGroupRights
+* (bug 18799) Special:Userlogin now handles correctly the returnto parameter
+  to not link back to Special:Userlogout when user's language isn't the same as
+  content's language
 
 == API changes in 1.16 ==
 
index 3af372d..2aa6977 100644 (file)
@@ -47,8 +47,7 @@ class LoginForm {
         * @param WebRequest $request A WebRequest object passed by reference
         */
        function LoginForm( &$request, $par = '' ) {
-               global $wgLang, $wgHiddenPrefs, $wgEnableEmail;
-               global $wgAuth, $wgRedirectOnLogin;
+               global $wgAuth, $wgHiddenPrefs, $wgEnableEmail, $wgRedirectOnLogin;
 
                $this->mType = ( $par == 'signup' ) ? $par : $request->getText( 'type' ); # Check for [[Special:Userlogin/signup]]
                $this->mName = $request->getText( 'wpName' );
@@ -92,7 +91,8 @@ class LoginForm {
                $wgAuth->setDomain( $this->mDomain );
 
                # When switching accounts, it sucks to get automatically logged out
-               if( $this->mReturnTo == $wgLang->specialPage( 'Userlogout' ) ) {
+               $returnToTitle = Title::newFromText( $this->mReturnTo );
+               if( is_object( $returnToTitle ) && $returnToTitle->isSpecial( 'Userlogout' ) ) {
                        $this->mReturnTo = '';
                        $this->mReturnToQuery = '';
                }