Page MenuHomePhabricator

$log_ids can not be counted in AbuseFilter.hooks.php
Closed, ResolvedPublic

Description

Error log:

mod_fcgid: stderr: PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /extensions/AbuseFilter/includes/AbuseFilter.hooks.php on line 257, referer: <URL>

mod_fcgid: stderr: PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /extensions/AbuseFilter/includes/AbuseFilter.hooks.php on line 269, referer: <URL>

The line 257 ane line 269 is:

if ( count( $log_ids ) ) {

This is a PHP 7.2 compatibility issue. In PHP 7.2:

An E_WARNING will now be emitted when attempting to count() non-countable types (this includes the sizeof() alias function).

Details

Related Gerrit Patches:
mediawiki/extensions/AbuseFilter : masterCompatible with PHP 7.2, avoid passing null to count()

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 30 2018, 4:59 AM
RazeSoldier moved this task from Unsorted to PHP 7.2 on the [DO NOT USE] NewPHP board.
RazeSoldier updated the task description. (Show Details)Jan 31 2018, 10:42 AM

Change 406986 had a related patch set uploaded (by 星耀晨曦; owner: 星耀晨曦):
[mediawiki/extensions/AbuseFilter@master] Avoid passing to count()

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

RazeSoldier updated the task description. (Show Details)Jan 31 2018, 3:16 PM
RazeSoldier renamed this task from $log_ids can not be counted to $log_ids can not be counted in AbuseFilter.hooks.php.Jan 31 2018, 3:52 PM

Change 406986 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Compatible with PHP 7.2, avoid passing null to count()

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

RazeSoldier closed this task as Resolved.Feb 3 2018, 3:54 PM
RazeSoldier removed a project: Patch-For-Review.