Revision::newFromTitle() returns null sometimes. Protect against the errors.
authorSean Colombo <sean_colombo@users.mediawiki.org>
Thu, 29 Sep 2011 23:11:31 +0000 (23:11 +0000)
committerSean Colombo <sean_colombo@users.mediawiki.org>
Thu, 29 Sep 2011 23:11:31 +0000 (23:11 +0000)
includes/Title.php

index b31b87e..4868761 100644 (file)
@@ -3575,6 +3575,9 @@ class Title {
                }
                # Get the article text
                $rev = Revision::newFromTitle( $nt );
+               if( !is_object( $rev ) ){
+                       return false;
+               }
                $text = $rev->getText();
                # Does the redirect point to the source?
                # Or is it a broken self-redirect, usually caused by namespace collisions?