X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fuser%2FExternalUserNames.php;h=f953b144d8051682504caeebd2807b08dbc6591a;hb=2c7a212afa50fe329801180571db01f62e77c708;hp=13ac6b256600cdc8bd0eba479c01e10fec28bef4;hpb=1ed097a16517656998d3e4d00d4e60d710a88f25;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/ExternalUserNames.php b/includes/user/ExternalUserNames.php index 13ac6b2566..f953b144d8 100644 --- a/includes/user/ExternalUserNames.php +++ b/includes/user/ExternalUserNames.php @@ -56,7 +56,7 @@ class ExternalUserNames { 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 ); } @@ -116,4 +116,18 @@ class ExternalUserNames { 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 ); + } + }