From f8d56fe7aef6980d4f8ab0aa225e30667c22099c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 20 May 2011 22:01:50 +0000 Subject: [PATCH] * (bug 29063) When viewing list=recentchanges&rcprop=loginfo for an unblock entry, get undefined index Unblocks have no params, so skip adding info --- includes/api/ApiQueryLogEvents.php | 19 +++++++++++++------ includes/api/ApiQueryRecentChanges.php | 7 +++++-- includes/api/ApiQueryWatchlist.php | 7 +++++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 8cb9b6b4a1..f69b7a998d 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -198,13 +198,14 @@ class ApiQueryLogEvents extends ApiQueryBase { /** * @param $result ApiResult - * @param $vals - * @param $params - * @param $type + * @param $vals array + * @param $params string + * @param $type string + * @param $action string * @param $ts * @return array */ - public static function addLogParams( $result, &$vals, $params, $type, $ts ) { + public static function addLogParams( $result, &$vals, $params, $type, $action, $ts ) { $params = explode( "\n", $params ); switch ( $type ) { case 'move': @@ -234,6 +235,9 @@ class ApiQueryLogEvents extends ApiQueryBase { $params = null; break; case 'block': + if ( $action == 'unblock' ) { + break; + } $vals2 = array(); list( $vals2['duration'], $vals2['flags'] ) = $params; @@ -283,8 +287,11 @@ class ApiQueryLogEvents extends ApiQueryBase { $vals['actionhidden'] = ''; } else { self::addLogParams( - $this->getResult(), $vals, - $row->log_params, $row->log_type, + $this->getResult(), + $vals, + $row->log_params, + $row->log_type, + $row->log_action, $row->log_timestamp ); } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 896914fdb8..0260212033 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -437,8 +437,11 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { $vals['logaction'] = $row->rc_log_action; ApiQueryLogEvents::addLogParams( $this->getResult(), - $vals, $row->rc_params, - $row->rc_log_type, $row->rc_timestamp + $vals, + $row->rc_params, + $row->rc_log_action, + $row->rc_log_type, + $row->rc_timestamp ); } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 9cc8048603..9172a54d00 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -306,8 +306,11 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $vals['logaction'] = $row->rc_log_action; ApiQueryLogEvents::addLogParams( $this->getResult(), - $vals, $row->rc_params, - $row->rc_log_type, $row->rc_timestamp + $vals, + $row->rc_params, + $row->rc_log_type, + $row->rc_log_action, + $row->rc_timestamp ); } -- 2.20.1