From: Alexandre Emsenhuber Date: Wed, 9 Feb 2011 17:05:52 +0000 (+0000) Subject: Fix for r81675: Skin::getTitle() will return null when $wgTitle is null and $wgOut... X-Git-Tag: 1.31.0-rc.0~32094 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=ebcd89f35bac04080b8907f3a971b6b885dad84b;p=lhc%2Fweb%2Fwiklou.git Fix for r81675: Skin::getTitle() will return null when $wgTitle is null and $wgOut->setTitle() not called, resulting in the following when passing a non-null parameter to User::getSkin(): Catchable fatal error: Argument 1 passed to Title::equals() must be an instance of Title, null given, called in includes/User.php on line 2255 and defined in includes/Title.php on line 3689 --- diff --git a/includes/User.php b/includes/User.php index 46d6f42db3..90875cbaa5 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2255,7 +2255,7 @@ class User { $this->mSkin = $this->createSkinObject(); $this->mSkin->setTitle( $wgOut->getTitle() ); } - if ( $t && !$t->equals( $this->mSkin->getTitle() ) ) { + if ( $t && ( !$this->mSkin->getTitle() || !$t->equals( $this->mSkin->getTitle() ) ) ) { $skin = $this->createSkinObject(); $skin->setTitle( $t ); return $skin;