Merge "SkinTemplate: extract formatLanguageName() from outputPage()"
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogin.php
index 039f569..b7d01c8 100644 (file)
@@ -151,7 +151,7 @@ class LoginForm extends SpecialPage {
 
                global $wgSecureLogin;
                if (
-                       $this->mType != 'signup' &&
+                       $this->mType !== 'signup' &&
                        $wgSecureLogin &&
                        WebRequest::detectProtocol() !== 'https'
                ) {
@@ -747,7 +747,12 @@ class LoginForm extends SpecialPage {
                                } else {
                                        $user->invalidateCache();
                                }
-                               $user->setCookies( null, $wgSecureLogin && !$this->mStickHTTPS ? false : null );
+
+                               if( $wgSecureLogin && !$this->mStickHTTPS ) {
+                                       $user->setCookies( null, false );
+                               } else {
+                                       $user->setCookies();
+                               }
                                self::clearLoginToken();
 
                                // Reset the throttle
@@ -980,7 +985,7 @@ class LoginForm extends SpecialPage {
                        $returnToTitle = Title::newMainPage();
                }
 
-               if( $wgSecureLogin && !$this->mStickHTTPS ) {
+               if ( $wgSecureLogin && !$this->mStickHTTPS ) {
                        $options = array( 'http' );
                        $proto = PROTO_HTTP;
                } else {
@@ -992,7 +997,7 @@ class LoginForm extends SpecialPage {
                        $redirectUrl = $returnToTitle->getFullURL( $returnToQuery, false, $proto );
                        $this->getOutput()->redirect( $redirectUrl );
                } else {
-                       $this->getOutput()->addReturnTo( $returnToTitle, $returnToQuery, $options );
+                       $this->getOutput()->addReturnTo( $returnToTitle, $returnToQuery, null, $options );
                }
        }