Page move fix: when checking for redirects, don't die if redirected title is invalid...
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 8 Aug 2004 01:30:39 +0000 (01:30 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 8 Aug 2004 01:30:39 +0000 (01:30 +0000)
includes/Title.php

index 9db099f..67c8fac 100644 (file)
@@ -1178,7 +1178,8 @@ class Title {
                # Does the redirect point to the source?
                if ( preg_match( "/\\[\\[\\s*([^\\]]*)]]/", $obj->cur_text, $m ) ) {
                        $redirTitle = Title::newFromText( $m[1] );
-                       if ( 0 != strcmp( $redirTitle->getPrefixedDBkey(), $this->getPrefixedDBkey() ) ) {
+                       if( !is_object( $redirTitle ) ||
+                               $redirTitle->getPrefixedDBkey() != $this->getPrefixedDBkey() ) {
                                return false;
                        }
                }