$key = wfMemcKey( 'acctcreate', 'ip', $ip );
$value = $cache->get( $key );
if ( !$value ) {
- $cache->set( $key, 0, 86400 );
+ $cache->set( $key, 0, $cache::TTL_DAY );
}
if ( $value >= $wgAccountCreationThrottle ) {
return Status::newFatal( 'acct_creation_throttle_hit', $wgAccountCreationThrottle );
// Give general extensions, such as a captcha, a chance to abort logins
$abort = self::ABORTED;
if ( !Hooks::run( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$msg ) ) ) {
- if ( !in_array( $abort, self::$statusCodes, true ) ) {
+ if ( !in_array( $abort, array_keys( self::$statusCodes ), true ) ) {
throw new Exception( 'Invalid status code returned from AbortLogin hook: ' . $abort );
}
$this->mAbortLoginErrorMsg = $msg;