63 $pos = strpos( $userName,
'>' );
64 if ( $pos !==
false ) {
65 $iw = explode(
':', substr( $userName, 0, $pos ) );
66 $firstIw = array_shift( $iw );
67 $services = MediaWikiServices::getInstance();
68 $interwikiLookup = $services->getInterwikiLookup();
69 if ( $interwikiLookup->isValidInterwiki( $firstIw ) ) {
70 $title = $services->getNamespaceInfo()->getCanonicalName(
NS_USER ) .
71 ':' . substr( $userName, $pos + 1 );
79 return SpecialPage::getTitleFor(
'Contributions', $userName );
102 if ( $this->assignKnownUsers ) {
108 if ( !isset( $this->triedCreations[$name] ) ) {
109 $this->triedCreations[$name] =
true;
110 if ( !Hooks::run(
'ImportHandleUnknownUser', [ $name ] ) &&
128 return substr( $this->usernamePrefix .
'>' . $name, 0, 255 );
138 return strpos( $username,
'>' ) !==
false;
148 if ( !self::isExternal( $username ) ) {
152 return substr( $username, strpos( $username,
'>' ) + 1 );
Class to parse and build external user names.
static getUserLinkTitle( $userName)
Get a target Title to link a username.
addPrefix( $name)
Add an interwiki prefix to the username regardless of circumstances.
__construct( $usernamePrefix, $assignKnownUsers)
static isExternal( $username)
Tells whether the username is external or not.
static getLocal( $username)
Get local part of the user name.
applyPrefix( $name)
Add an interwiki prefix to the username, if appropriate.
static isUsableName( $name)
Usernames which fail to pass this function will be blocked from user login and new account registrati...
static idFromName( $name, $flags=self::READ_NORMAL)
Get database id given a user name.