More sensible behavior when special page aliases conflict
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 19 Sep 2014 18:32:43 +0000 (14:32 -0400)
committerNikerabbit <niklas.laxstrom@gmail.com>
Thu, 25 Sep 2014 07:57:01 +0000 (07:57 +0000)
commitad522beeea5037ced24781df515b880cf75733ca
tree9f57da22168be1ca9eaee3af94c17f4df07c2fb1
parent89ac348b77aa68ad487a0cc1f5583acc27ccd8a3
More sensible behavior when special page aliases conflict

Right now, SpecialPageFactory::getAliasListObject() just chooses the
last-seen alias and allows any alias to completely override the page's
"canonical" name (from SpecialPageFactory::$list or $wgSpecialPages).
Although the latter doesn't come up often since (almost?) all special pages
have their canonical name as one of their English-language aliases.

More sensible behavior is to always prefer the "canonical" name over any
conflicting aliases, and to prefer an alias that's the first alias for a
special page over one that is a fallback.

Also, when a special page's first alias winds up not actually referring
to that special page, we MUST NOT go redirecting other names for that
special page to that wrong alias.

Bug: 70686
Change-Id: I4b17ec0fdc87b4b0d7ae9d9eea7ffacb54dd6891
includes/specialpage/SpecialPageFactory.php
languages/Language.php
tests/phpunit/includes/specialpage/SpecialPageFactoryTest.php