Add urlencode for URL encoding of lang values
authorFomafix <fomafix@googlemail.com>
Fri, 14 Jul 2017 18:54:55 +0000 (20:54 +0200)
committerFomafix <fomafix@googlemail.com>
Fri, 14 Jul 2017 18:54:55 +0000 (20:54 +0200)
Change-Id: If7d21223536d1873b3bfed154649d3dcb9850f9b

includes/specialpage/LoginSignupSpecialPage.php

index 5c048a2..0600642 100644 (file)
@@ -761,7 +761,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                if ( $this->showCreateAccountLink() ) {
                        # Pass any language selection on to the mode switch link
                        if ( $this->mLanguage ) {
-                               $linkq .= '&uselang=' . $this->mLanguage;
+                               $linkq .= '&uselang=' . urlencode( $this->mLanguage );
                        }
                        // Supply URL, login template creates the button.
                        $template->set( 'createOrLoginHref', $titleObj->getLocalURL( $linkq ) );
@@ -1149,7 +1149,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                                $linkq = $this->getReturnToQueryStringFragment();
                                // Pass any language selection on to the mode switch link
                                if ( $this->mLanguage ) {
-                                       $linkq .= '&uselang=' . $this->mLanguage;
+                                       $linkq .= '&uselang=' . urlencode( $this->mLanguage );
                                }
                                $loggedIn = $this->getUser()->isLoggedIn();