Add comments to Linker::formatLinksInComment()
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 341983d..ddd0780 100644 (file)
@@ -555,7 +555,11 @@ class SkinTemplate extends Skin {
                # $this->getTitle() will just give Special:Badtitle, which is
                # not especially useful as a returnto parameter. Use the title
                # from the request instead, if there was one.
-               $page = Title::newFromURL( $request->getVal( 'title', '' ) );
+               if ( $this->getUser()->isAllowed( 'read' ) ) {
+                       $page = $this->getTitle();
+               } else {
+                       $page = Title::newFromText( $request->getVal( 'title', '' ) );
+               }
                $page = $request->getVal( 'returnto', $page );
                $a = array();
                if ( strval( $page ) !== '' ) {
@@ -639,7 +643,6 @@ class SkinTemplate extends Skin {
                        $is_signup = $request->getText( 'type' ) == 'signup';
 
                        # anonlogin & login are the same
-                       global $wgSecureLogin;
                        $proto = $wgSecureLogin ? PROTO_HTTPS : null;
 
                        $login_id = $this->showIPinHeader() ? 'anonlogin' : 'login';