Followup to r49493: Tweak this so we only set the title if explicitly asking for...
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 20 Apr 2009 14:32:41 +0000 (14:32 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 20 Apr 2009 14:32:41 +0000 (14:32 +0000)
includes/Skin.php
includes/User.php

index 39d93dd..7994ca2 100644 (file)
@@ -24,6 +24,7 @@ class Skin extends Linker {
        /**#@-*/
        protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
        protected $skinname = 'standard';
+       protected $mTitle = null;
 
        /** Constructor, call parent constructor */
        function Skin() { parent::__construct(); }
@@ -283,6 +284,11 @@ class Skin extends Linker {
        public function setTitle( $t ) {
                $this->mTitle = $t;
        }
+       
+       /** Get the title */
+       public function getTitle() {
+               return $this->mTitle;
+       }
 
        function outputPage( OutputPage $out ) {
                global $wgDebugComments;
@@ -1920,4 +1926,4 @@ END;
                wfProfileOut( __METHOD__ );
                return $bar;
        }
-}
+}
\ No newline at end of file
index c1d2664..c7c865e 100644 (file)
@@ -2166,11 +2166,13 @@ class User {
                        $this->mSkin =& Skin::newFromKey( $userSkin );
                        wfProfileOut( __METHOD__ );
                }
-               if ( !$t ) {
-                       global $wgOut;
-                       $t = $wgOut->getTitle();
+               if( $t || !$this->mSkin->getTitle() ) {
+                       if ( !$t ) {
+                               global $wgOut;
+                               $t = $wgOut->getTitle();
+                       }
+                       $this->mSkin->setTitle( $t );
                }
-               $this->mSkin->setTitle( $t );
                return $this->mSkin;
        }
 
@@ -3515,4 +3517,4 @@ class User {
                return true;
        }
 
-}
+}
\ No newline at end of file