Introduce TitleParser::makeTitleValueSafe()
authorAryeh Gregor <ayg@aryeh.name>
Tue, 13 Aug 2019 11:33:43 +0000 (14:33 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Wed, 14 Aug 2019 18:34:39 +0000 (21:34 +0300)
commitc503f129c3ed66f5d4865386bc0e26d11fa99a3c
tree922f6c4d55f344396b6dbaa1012d082e73928878
parent8f2f5b916b9c5fd0e3dde53b1cc716b0ac3c1c3c
Introduce TitleParser::makeTitleValueSafe()

This works exactly the same as Title::makeTitleSafe(), but for
TitleValues. 100% test coverage of splitTitleString(). Also added
identical parallel tests for Title::makeTitleSafe() to verify that
behavior is the same.

Along the way, I discovered that TitleValue doesn't allow an empty page
name even if there's an interwiki prefix, which is wrong, so I fixed it.

Bug: T220966
Change-Id: I4b915244ceee4c1857178dd68dcdf57f1ee32200
includes/title/MediaWikiTitleCodec.php
includes/title/TitleParser.php
includes/title/TitleValue.php
tests/phpunit/includes/title/MediaWikiTitleCodecTest.php
tests/phpunit/unit/includes/title/TitleValueTest.php