diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2021-05-04 23:35:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2021-05-04 23:35:53 +0000 |
commit | 1ed7dcd022248b44758dbb1d077e16074b5d2077 (patch) | |
tree | 0ec731b58c7184893d3f0c18a108dbc0bb7fe5ff /includes/user | |
parent | 6d848e5db6c216c2d52e15aacd6152f6105b2165 (diff) | |
parent | b491279268fe1769a8787cbf30b5309c8aa91363 (diff) | |
download | mediawikicore-1ed7dcd022248b44758dbb1d077e16074b5d2077.tar.gz mediawikicore-1ed7dcd022248b44758dbb1d077e16074b5d2077.zip |
Merge "Hard Deprecate User ::getCanonicalName, ::isUsableName, ::isCreatableName"
Diffstat (limited to 'includes/user')
-rw-r--r-- | includes/user/ExternalUserNames.php | 4 | ||||
-rw-r--r-- | includes/user/User.php | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/includes/user/ExternalUserNames.php b/includes/user/ExternalUserNames.php index f4afc8cec779..6727bae804aa 100644 --- a/includes/user/ExternalUserNames.php +++ b/includes/user/ExternalUserNames.php @@ -21,6 +21,7 @@ */ use MediaWiki\MediaWikiServices; +use MediaWiki\User\UserNameUtils; /** * Class to parse and build external user names @@ -105,7 +106,8 @@ class ExternalUserNames { * username), otherwise the name with the prefix prepended. */ public function applyPrefix( $name ) { - if ( User::getCanonicalName( $name, 'usable' ) === false ) { + $userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils(); + if ( $userNameUtils->getCanonical( $name, UserNameUtils::RIGOR_USABLE ) === false ) { return $name; } diff --git a/includes/user/User.php b/includes/user/User.php index 183363ce0423..1247f2adcf76 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -1026,11 +1026,14 @@ class User implements Authority, IDBAccessObject, UserIdentity, UserEmailContact * If an account already exists in this form, login will be blocked * by a failure to pass this function. * - * @deprecated since 1.35, use the UserNameUtils service + * @deprecated since 1.35, use the UserNameUtils service. + * Hard deprecated since 1.37 + * * @param string $name Name to match * @return bool */ public static function isUsableName( $name ) { + wfDeprecated( __METHOD__, '1.35' ); return MediaWikiServices::getInstance()->getUserNameUtils()->isUsable( $name ); } @@ -1081,11 +1084,14 @@ class User implements Authority, IDBAccessObject, UserIdentity, UserEmailContact * Additional preventions may be added here rather than in * isValidUserName() to avoid disrupting existing accounts. * - * @deprecated since 1.35, use the UserNameUtils service + * @deprecated since 1.35, use the UserNameUtils service. + * Hard deprecated since 1.37 + * * @param string $name String to match * @return bool */ public static function isCreatableName( $name ) { + wfDeprecated( __METHOD__, '1.35' ); return MediaWikiServices::getInstance()->getUserNameUtils()->isCreatable( $name ); } @@ -1154,7 +1160,9 @@ class User implements Authority, IDBAccessObject, UserIdentity, UserEmailContact * Given unvalidated user input, return a canonical username, or false if * the username is invalid. * - * @deprecated since 1.35, use the UserNameUtils service + * @deprecated since 1.35, use the UserNameUtils service. + * Hard deprecated since 1.37 + * * @param string $name User input * @param string|bool $validate Type of validation to use: * - false No validation @@ -1166,6 +1174,7 @@ class User implements Authority, IDBAccessObject, UserIdentity, UserEmailContact * @return bool|string */ public static function getCanonicalName( $name, $validate = 'valid' ) { + wfDeprecated( __METHOD__, '1.35' ); // Backwards compatibility with strings / false $validationLevels = [ 'valid' => UserNameUtils::RIGOR_VALID, |