Cleanup to r70900, r72481: don't construct new skin objects just because the Title...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 8 Feb 2011 01:08:06 +0000 (01:08 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 8 Feb 2011 01:08:06 +0000 (01:08 +0000)
includes/User.php

index 1af15ea..834c770 100644 (file)
@@ -2247,21 +2247,16 @@ class User {
         * @todo: FIXME : need to check the old failback system [AV]
         */
        function getSkin( $t = null ) {
-               if ( $t ) {
+               if( !$this->mSkin ) {
+                       global $wgOut;
+                       $this->mSkin = $this->createSkinObject();
+                       $this->mSkin->setTitle( $wgOut->getTitle() );
+               }
+               if ( $t && !$t->equals( $this->mSkin->getTitle() ) ) {
                        $skin = $this->createSkinObject();
                        $skin->setTitle( $t );
                        return $skin;
                } else {
-                       if ( !$this->mSkin ) {
-                               $this->mSkin = $this->createSkinObject();
-                       }
-
-                       if ( !$this->mSkin->getTitle() ) {
-                               global $wgOut;
-                               $t = $wgOut->getTitle();
-                               $this->mSkin->setTitle($t);
-                       }
-
                        return $this->mSkin;
                }
        }