From 088ca5368532c0feb8590abf601883be408740ce Mon Sep 17 00:00:00 2001 From: RazeSoldier Date: Wed, 31 Jan 2018 18:52:34 +0800 Subject: [PATCH] Compatible with PHP 7.2, avoid passing null to count() Bug: T185981 Change-Id: I2ee2f79124935426ee06b6e0bcb987d1676fdba1 --- includes/AbuseFilter.hooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/AbuseFilter.hooks.php b/includes/AbuseFilter.hooks.php index 3175e021f..1832ba854 100644 --- a/includes/AbuseFilter.hooks.php +++ b/includes/AbuseFilter.hooks.php @@ -254,7 +254,7 @@ class AbuseFilterHooks { $log_ids = $vars->getVar( 'local_log_ids' )->toNative(); $dbw = wfGetDB( DB_MASTER ); - if ( count( $log_ids ) ) { + if ( $log_ids !== null && count( $log_ids ) ) { $dbw->update( 'abuse_filter_log', [ 'afl_rev_id' => $revision->getId() ], [ 'afl_id' => $log_ids ], @@ -266,7 +266,7 @@ class AbuseFilterHooks { if ( $vars->getVar( 'global_log_ids' ) ) { $log_ids = $vars->getVar( 'global_log_ids' )->toNative(); - if ( count( $log_ids ) ) { + if ( $log_ids !== null && count( $log_ids ) ) { global $wgAbuseFilterCentralDB; $fdb = wfGetDB( DB_MASTER, [], $wgAbuseFilterCentralDB );