X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsession%2FBotPasswordSessionProvider.php;h=5831b098faf0e7e7dd5b3212901a773d9c14495e;hb=8523b82d83cbb7f248e8b03de1d130f0cecc64f7;hp=44199bdec4605da489ad80762a1138c703ad7565;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/BotPasswordSessionProvider.php b/includes/session/BotPasswordSessionProvider.php index 44199bdec4..5831b098fa 100644 --- a/includes/session/BotPasswordSessionProvider.php +++ b/includes/session/BotPasswordSessionProvider.php @@ -120,7 +120,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie { if ( $missingKeys ) { $this->logger->info( 'Session "{session}": Missing metadata: {missing}', [ 'session' => $info, - 'missing' => join( ', ', $missingKeys ), + 'missing' => implode( ', ', $missingKeys ), ] ); return false; } @@ -147,7 +147,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie { } $status = $bp->getRestrictions()->check( $request ); - if ( !$status->isOk() ) { + if ( !$status->isOK() ) { $this->logger->info( 'Session "{session}": Restrictions check failed', [ @@ -165,16 +165,19 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie { return true; } + /** + * @codeCoverageIgnore + */ public function preventSessionsForUser( $username ) { BotPassword::removeAllPasswordsForUser( $username ); } public function getAllowedUserRights( SessionBackend $backend ) { if ( $backend->getProvider() !== $this ) { - throw new InvalidArgumentException( 'Backend\'s provider isn\'t $this' ); + throw new \InvalidArgumentException( 'Backend\'s provider isn\'t $this' ); } $data = $backend->getProviderMetadata(); - if ( $data ) { + if ( $data && isset( $data['rights'] ) && is_array( $data['rights'] ) ) { return $data['rights']; }