Special:Log title can be an invalid thus trigger a Fatal error
authorAntoine Musso <hashar@users.mediawiki.org>
Sun, 20 Nov 2011 22:39:26 +0000 (22:39 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sun, 20 Nov 2011 22:39:26 +0000 (22:39 +0000)
follow up r103711

includes/specials/SpecialLog.php

index d0c42df..b140a17 100644 (file)
@@ -102,7 +102,7 @@ class SpecialLog extends SpecialPage {
                if( in_array( $opts->getValue( 'type' ), $this->typeOnUser ) ) {
                        # ok we have a type of log which expect a user title.
                        $target = Title::newFromText( $opts->getValue( 'page' ) );
-                       if( $target->getNamespace() === NS_MAIN ) {
+                       if( $target && $target->getNamespace() === NS_MAIN ) {
                                # User forgot to add 'User:', we are adding it for him
                                $opts->setValue( 'page',
                                        Title::makeTitleSafe( NS_USER, $opts->getValue( 'page' ) )