if ( $interwikiLookup->isValidInterwiki( $firstIw ) ) {
$title = MWNamespace::getCanonicalName( NS_USER ) . ':' . substr( $userName, $pos + 1 );
if ( $iw ) {
- $title = join( ':', $iw ) . ':' . $title;
+ $title = implode( ':', $iw ) . ':' . $title;
}
return Title::makeTitle( NS_MAIN, $title, '', $firstIw );
}
return strpos( $username, '>' ) !== false;
}
+ /**
+ * Get local part of the user name
+ *
+ * @param string $username Username to get
+ * @return string
+ */
+ public static function getLocal( $username ) {
+ if ( !self::isExternal( $username ) ) {
+ return $username;
+ }
+
+ return substr( $username, strpos( $username, '>' ) + 1 );
+ }
+
}