Bug: T127114
Change-Id: I020cecf345c6bad4f461b70203f0bd29792de1f8
Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
*/
public static function incrementLoginThrottle( $username ) {
global $wgPasswordAttemptThrottle, $wgRequest;
*/
public static function incrementLoginThrottle( $username ) {
global $wgPasswordAttemptThrottle, $wgRequest;
- $username = User::getCanonicalName( $username, 'usable' ) ?: $username;
+ $canUsername = User::getCanonicalName( $username, 'usable' );
+ $username = $canUsername !== false ? $canUsername : $username;
$throttleCount = 0;
if ( is_array( $wgPasswordAttemptThrottle ) ) {
$throttleCount = 0;
if ( is_array( $wgPasswordAttemptThrottle ) ) {
*/
public static function clearLoginThrottle( $username ) {
global $wgRequest, $wgPasswordAttemptThrottle;
*/
public static function clearLoginThrottle( $username ) {
global $wgRequest, $wgPasswordAttemptThrottle;
- $username = User::getCanonicalName( $username, 'usable' ) ?: $username;
+ $canUsername = User::getCanonicalName( $username, 'usable' );
+ $username = $canUsername !== false ? $canUsername : $username;
if ( is_array( $wgPasswordAttemptThrottle ) ) {
$throttleConfig = $wgPasswordAttemptThrottle;
if ( is_array( $wgPasswordAttemptThrottle ) ) {
$throttleConfig = $wgPasswordAttemptThrottle;