Page MenuHomePhabricator

TitleParser needs a substitute for Title::makeTitleSafe()
Closed, ResolvedPublic


When trying to port Title usage to TitleValue, I see no good substitute for makeTitleSafe(). TitleParser::parseTitle() doesn't behave the same if there are things that might look like namespace prefixes, and also doesn't support providing a fragment or interwiki. This stops conversion of a nontrivial amount of Title usage. E.g., in Linker:

$title = Title::makeTitleSafe( NS_FILE, $submatch[1] );
if ( $title ) {
    $thelink = Linker::makeMediaLinkObj( $title, $text );

$submatch[1] might not be a valid title. So what should this look like without Title?

Event Timeline

Assuming this is about the MediaWiki code base.

Change 530190 had a related patch set uploaded (by simetrical; owner: simetrical):
[mediawiki/core@master] Introduce TitleParser::makeTitleValueSafe()

Change 530190 merged by jenkins-bot:
[mediawiki/core@master] Introduce TitleParser::makeTitleValueSafe()

Simetrical claimed this task.