Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/231974

Change subject: Fix array access error in LoginForm
......................................................................

Fix array access error in LoginForm

The status code from a login attempt should be an integer but
sometimes is not; due to differences in type juggling in $a[$x]
and switch($x) it will pass the error handling in the switch and
cause an error in the array access.

Bug: T109193
Change-Id: I56cb3e9ba87c08fdff4c389aae22a5c913cb3484
---
M includes/api/ApiLogin.php
M includes/specials/SpecialUserlogin.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/231974/1

diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php
index 8c65310..0e0d0f3 100644
--- a/includes/api/ApiLogin.php
+++ b/includes/api/ApiLogin.php
@@ -179,7 +179,7 @@
                LoggerFactory::getInstance( 'authmanager' )->info( 'Login 
attempt', array(
                        'event' => 'login',
                        'successful' => $authRes === LoginForm::SUCCESS,
-                       'status' => LoginForm::$statusCodes[$authRes],
+                       'status' => LoginForm::$statusCodes[(int)$authRes],
                ) );
        }
 
diff --git a/includes/specials/SpecialUserlogin.php 
b/includes/specials/SpecialUserlogin.php
index 0b500f4..c1b75e4 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -1067,7 +1067,7 @@
                LoggerFactory::getInstance( 'authmanager' )->info( 'Login 
attempt', array(
                        'event' => 'login',
                        'successful' => $status === self::SUCCESS,
-                       'status' => LoginForm::$statusCodes[$status],
+                       'status' => LoginForm::$statusCodes[(int)$status],
                ) );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/231974
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56cb3e9ba87c08fdff4c389aae22a5c913cb3484
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to