From 26338396301b39071093a75af05ee2eddd7d5b11 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 9 Feb 2018 12:00:07 -0800 Subject: [PATCH] API: Fix "Undefined index: wiki" warnings Bug: T186914 Change-Id: I7e9d5524302f5f90d0e82f0f4d41a542e2990ed5 --- includes/api/ApiQueryAbuseLog.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiQueryAbuseLog.php b/includes/api/ApiQueryAbuseLog.php index 33d2e82d6..2a22a207e 100644 --- a/includes/api/ApiQueryAbuseLog.php +++ b/includes/api/ApiQueryAbuseLog.php @@ -140,8 +140,10 @@ class ApiQueryAbuseLog extends ApiQueryBase { $this->addWhereIf( [ 'afl_filter' => $params['filter'] ], isset( $params['filter'] ) ); $this->addWhereIf( $notDeletedCond, !SpecialAbuseLog::canSeeHidden( $user ) ); - $this->addWhereIf( [ 'afl_wiki' => $params['wiki'] ], - $wgAbuseFilterIsCentral && isset( $params['wiki'] ) ); + if ( isset( $params['wiki'] ) ) { + // 'wiki' won't be set if $wgAbuseFilterIsCentral = false + $this->addWhereIf( [ 'afl_wiki' => $params['wiki'] ], $wgAbuseFilterIsCentral ); + } $title = $params['title']; if ( !is_null( $title ) ) {