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