Page MenuHomePhabricator

Warning: strpos(): Empty delimiter in /.../AbuseFilter.parser.php on line 1912
Closed, ResolvedPublic

Description

Author: accnospamtom

Description:
Warning triggered in our wiki when uploading, moving, deleting a file or deleting a page ...

In this cases, the var $needle isn't defined (I don't know why), so strpos fails.

I manually fixed this warning in our wiki by adding

if (isset($needle)) {
...
}

around the foreach-part in at line 1912

https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FAbuseFilter/9c1d878b76ff9e2f65fda6556b1fec0b67e1bb1f/AbuseFilter.parser.php#L1912


Version: master
Severity: normal

Details

Reference
bz60203

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:04 AM
bzimport added a project: AbuseFilter.
bzimport set Reference to bz60203.
bzimport created this task.Jan 18 2014, 1:26 PM

This looks like it's related to one of your specific filters. What filters are you using?

accnospamtom wrote:

Ohh, I'm such an idiot ... I didn't think of our filters ... ;)

this filter was causing it:

contains_any( lcase ( rmwhitespace (added_lines) ),
"{{trash}}",
"{{dorftrottel}}",
"{{schmiede}}",
) &
article_namespace != 10

Change 108220 had a related patch set uploaded by Jackmcbarn:
Don't pass empty strings to strpos

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

By the way, the problem happened to you because of the extra comma after the last parameter to contains_any.

accnospamtom wrote:

thank you :)

Change 108220 merged by jenkins-bot:
Don't pass empty strings to strpos

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