44 if ( $foreignTitle->isNamespaceIdKnown() ) {
45 $foreignNs = $foreignTitle->getNamespaceId();
49 if ( $foreignNs < 100 && MWNamespace::exists( $foreignNs ) ) {
50 return Title::makeTitleSafe( $foreignNs, $foreignTitle->getText() );
56 $targetNs = MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex(
57 $foreignTitle->getNamespaceName() );
58 if ( $targetNs !==
false ) {
59 return Title::makeTitleSafe( $targetNs, $foreignTitle->getText() );
63 return Title::makeTitleSafe( 0, $foreignTitle->getFullText() );