Untested equivalent of r55262 ("When moving a page to a subpage of itself, don't...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 18 Aug 2009 20:28:26 +0000 (20:28 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 18 Aug 2009 20:28:26 +0000 (20:28 +0000)
includes/Title.php

index e6ff7a6..5b5c06f 100644 (file)
@@ -3074,7 +3074,11 @@ class Title {
                                break;
                        }
 
-                       if( $oldSubpage->getArticleId() == $this->getArticleId() )
+                       // We don't know whether this function was called before
+                       // or after moving the root page, so check both
+                       // $this and $nt
+                       if( $oldSubpage->getArticleId() == $this->getArticleId() ||
+                                       $oldSubpage->getArticleID() == $nt->getArticleId() )
                                // When moving a page to a subpage of itself,
                                // don't move it twice
                                continue;