Don't move twice when moving subpages to a subpage
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 18 Aug 2009 20:13:37 +0000 (20:13 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 18 Aug 2009 20:13:37 +0000 (20:13 +0000)
commit30837e8b98b12b82460bc8eafe4f5448513b0535
treeb209ee6f25d938e174119cd864dae2c2b6f20d2d
parentb454ab0df8ec092d6a45ab88081e49aa85d248be
Don't move twice when moving subpages to a subpage

(bug 14817) When a page got moved to a subpage of itself, and "move
subpages" was checked, the page got moved, then moved again, like Foo ->
Foo/Bar -> Foo/Bar/Bar.  There was an explicit check to prevent this,
but the check was incorrect: it used $ot->getArticleID() after $ot had
already been moved, so the ID was the redirect.  The behavior of
getArticleID() here isn't obvious, so I cached the ID in advance for
clarity instead of switching to $nt->getArticleID().

Brief inspection of Title::moveSubpages() suggests that that would be
affected too.  The third place we have this code copy-pasted (bleh) is
SpecialRenameuser, but that's not affected because usernames can't have
slashes in them.
RELEASE-NOTES
includes/specials/SpecialMovepage.php