/**
* A class to convert page titles on a foreign wiki (ForeignTitle objects) into
* page titles on the local wiki (Title objects), using a default namespace
/**
* A class to convert page titles on a foreign wiki (ForeignTitle objects) into
* page titles on the local wiki (Title objects), using a default namespace
if ( $foreignTitle->isNamespaceIdKnown() ) {
$foreignNs = $foreignTitle->getNamespaceId();
// For built-in namespaces (0 <= ID < 100), we try to find a local NS with
// the same namespace ID
if ( $foreignTitle->isNamespaceIdKnown() ) {
$foreignNs = $foreignTitle->getNamespaceId();
// For built-in namespaces (0 <= ID < 100), we try to find a local NS with
// the same namespace ID
return Title::makeTitleSafe( $foreignNs, $foreignTitle->getText() );
}
}
// Do we have a local namespace by the same name as the foreign
// namespace?
return Title::makeTitleSafe( $foreignNs, $foreignTitle->getText() );
}
}
// Do we have a local namespace by the same name as the foreign
// namespace?
if ( $targetNs !== false ) {
return Title::makeTitleSafe( $targetNs, $foreignTitle->getText() );
}
if ( $targetNs !== false ) {
return Title::makeTitleSafe( $targetNs, $foreignTitle->getText() );
}