Page MenuHomePhabricator

Filter does not detect new links when a page is created
Closed, ResolvedPublic

Description

Author: kazink

Description:
I am trying to prevent untrusted users from adding external links to pages on my wiki. I have created the filter with these conditions:

(length(added_links) > 0) & !('trusted_user' in user_groups)

and it matches all old edits that I would like to block. During testing it also blocks adding new links to existing pages.

But it fails to block creation of a new page containing external links (hit count is not increased). Maybe I am doing something wrong. I have tried the (length(added_links) > 0) alone, and it is the same. I also tried (length(all_links) > 0) with the same result: new users still can create pages containing external links. In the 'examination' all the filter condition versions perfectly match the modifications they should have blocked.

I have also tried (new_size > 0) and this one works fine (new page creations are blocked).

I have these settings for Emergency Disable feature (effectively turning it off, hopefully):
$wgAbuseFilterEmergencyDisableThreshold['default'] = 1;
$wgAbuseFilterEmergencyDisableCount['default'] = 100;
$wgAbuseFilterEmergencyDisableAge['default'] = 1;

I can provide an account to my wiki for someone to test it, if necessary. I had to disable creation of new users and anonymous editing because of spam.


Version: REL1_21-branch
Severity: major

Details

Reference
bz50869

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:52 AM
bzimport added a project: AbuseFilter.
bzimport set Reference to bz50869.
bzimport added a subscriber: Unknown Object (MLST).

kazink wrote:

First quick checks show that EditFilterMergedContent (MW 1.21) hook is not triggered on a new page creation, when the added_links filter is the only one active. It is triggered when the new_size filter is active. I will look deeper into it when I have more time.

The linked change should have fixed that. If this still occurs on the master of AbuseFilter, please reopen the bug.

kazink wrote:

It's fixed. Thank you.