54 $pieces = explode(
':',
$title, 2 );
68 $isNamespacePartValid = $ns ===
null
69 ? $this->contentLanguage->getNsIndex( $pieces[0] ) !== false
72 if ( count( $pieces ) === 2 && $isNamespacePartValid ) {
73 list( $namespaceName, $pageName ) = $pieces;
79 return new ForeignTitle( $ns, $namespaceName, $pageName );
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
A parser that translates page titles on a foreign wiki into ForeignTitle objects, with no knowledge o...
createForeignTitle( $title, $ns=null)
Creates a ForeignTitle object based on the page title, and optionally the namespace ID,...
Language $contentLanguage
__construct(Language $contentLanguage)
A parser that translates page titles into ForeignTitle objects.