From: Chad Horohoe Date: Tue, 8 Feb 2011 01:08:06 +0000 (+0000) Subject: Cleanup to r70900, r72481: don't construct new skin objects just because the Title... X-Git-Tag: 1.31.0-rc.0~32130 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=9ff0216ee2ab7dd336c53c51c68d78ba67380b92;p=lhc%2Fweb%2Fwiklou.git Cleanup to r70900, r72481: don't construct new skin objects just because the Title is passed. Use the skin object we already have if the titles are the same --- diff --git a/includes/User.php b/includes/User.php index 1af15eabbf..834c770f06 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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; } }