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