(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.
* (bug 20265) Make AncientPages and UnusedFiles work on SQLite
* Fixed XSS vulnerability for Internet Explorer clients (only pre-release
versions of MediaWiki were affected).
+* (bug 14817) Moving a page to a subpage of itself moves it twice
== API changes in 1.16 ==
$createRedirect = true;
}
+ # Do the actual move. First remember the old ID for later reference,
+ # so that we don't get the ID of the redirect.
+ $oldId = $ot->getArticleId();
$error = $ot->moveTo( $nt, true, $this->reason, $createRedirect );
if ( $error !== true ) {
# FIXME: show all the errors in a list, not just the first one
$skin = $wgUser->getSkin();
$count = 1;
foreach( $extraPages as $oldSubpage ) {
- if( $oldSubpage->getArticleId() == $ot->getArticleId() ) {
+ if( $oldSubpage->getArticleId() == $oldId ) {
# Already did this one.
continue;
}