Merge "Drop SpecialPageFactory::getList(), deprecated in 1.24"
[lhc/web/wiklou.git] / includes / user / ExternalUserNames.php
index 13ac6b2..f953b14 100644 (file)
@@ -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 );
+       }
+
 }