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