API: Fix "Undefined index: wiki" warnings

Bug: T186914
Change-Id: I7e9d5524302f5f90d0e82f0f4d41a542e2990ed5
This commit is contained in:
Kunal Mehta 2018-02-09 12:00:07 -08:00
parent 60130eb925
commit 2633839630

View file

@ -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 ) ) {