Page MenuHomePhabricator

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

Description

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 15 2019, 12:00 PM

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()

https://gerrit.wikimedia.org/r/530190

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

https://gerrit.wikimedia.org/r/530190

Simetrical closed this task as Resolved.Aug 18 2019, 9:30 AM
Simetrical claimed this task.