Make Titles with an unknown namespace ID refer to Special:Badtitle.
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 9 Jun 2017 16:39:33 +0000 (18:39 +0200)
committerTim Starling <tstarling@wikimedia.org>
Wed, 14 Jun 2017 04:31:07 +0000 (04:31 +0000)
commitfbc144965315cb1360500ef08ae9f4af15e76c43
treea93ae1de62c9ccebbc806f37263657a00842da60
parente51501bfb93ee04469c9275709c519f236fd57b0
Make Titles with an unknown namespace ID refer to Special:Badtitle.

Without this patch, Title::getPrefixedText() would return ":Foo"
if the namespace was unknown, potentially creating a misleading
link to the main namespace. With this change, getPrefixedText()
will return something like "Special:Badtitle/NS12345:Foo".

Note that round trip behavior is broken either way.

Bug: T165149
Change-Id: I0d491a2b58ff45f207f83ee62ca6e7e6ffbf790a
includes/Title.php
tests/phpunit/includes/TitleTest.php