From 3334db3b6662fab28c7b0a4bdaa4f1b58585da23 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 8 Aug 2004 01:30:39 +0000 Subject: [PATCH] Page move fix: when checking for redirects, don't die if redirected title is invalid. Error reported by Looxix in #mediawiki --- includes/Title.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 9db099f261..67c8facda0 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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; } } -- 2.20.1