From 9ff0216ee2ab7dd336c53c51c68d78ba67380b92 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 8 Feb 2011 01:08:06 +0000 Subject: [PATCH] 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 --- includes/User.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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; } } -- 2.20.1