Fix "Call to a member function on a non-object in /home/wikipedia/htdocs/test/w/inclu...
authorWil Mahan <wmahan@users.mediawiki.org>
Sun, 19 Sep 2004 08:53:12 +0000 (08:53 +0000)
committerWil Mahan <wmahan@users.mediawiki.org>
Sun, 19 Sep 2004 08:53:12 +0000 (08:53 +0000)
includes/Title.php

index 40d2de7..b84f149 100644 (file)
@@ -186,7 +186,7 @@ class Title {
                                
                                $rt = Title::newFromText( $m[1] );
                                # Disallow redirects to Special:Userlogout
-                               if ( $rt->getNamespace() == NS_SPECIAL && preg_match( '/^Userlogout/i', $rt->getText() ) ) {
+                               if ( !is_null($rt) && $rt->getNamespace() == NS_SPECIAL && preg_match( '/^Userlogout/i', $rt->getText() ) ) {
                                        $rt = NULL;
                                }
                        }