Merge "Pass $archivedRevisionCount to the ArticleDeleteComplete hook"
[lhc/web/wiklou.git] / includes / auth / ConfirmLinkSecondaryAuthenticationProvider.php
index 57f1e6b..beb11f4 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace MediaWiki\Auth;
 
-use StatusValue;
 use User;
 
 /**
@@ -51,7 +50,11 @@ class ConfirmLinkSecondaryAuthenticationProvider extends AbstractSecondaryAuthen
                        return AuthenticationResponse::newAbstain();
                }
 
-               $maybeLink = array_filter( $state['maybeLink'], function ( $req ) {
+               $maybeLink = array_filter( $state['maybeLink'], function ( $req ) use ( $user ) {
+                       if ( !$req->action ) {
+                               $req->action = AuthManager::ACTION_CHANGE;
+                       }
+                       $req->username = $user->getName();
                        return $this->manager->allowsAuthenticationDataChange( $req )->isGood();
                } );
                if ( !$maybeLink ) {