Fix for r81675: Skin::getTitle() will return null when $wgTitle is null and $wgOut...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 9 Feb 2011 17:05:52 +0000 (17:05 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 9 Feb 2011 17:05:52 +0000 (17:05 +0000)
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

includes/User.php

index 46d6f42..90875cb 100644 (file)
@@ -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;