Page MenuHomePhabricator

AbuseFilter: API action "abusefiltercheckmatch" ignores the "vars" parameter
Closed, ResolvedPublic

Description

Click in the URL above or follow the following steps:

  1. Go to [[pt:Special:Sandbox]]
  2. Select the action "abusefiltercheckmatch" in the drop-down menu
  3. Type in the filter field: length(user_name)>0
  4. Type in the vars field: {"user_name":"Foo"}

After this, click in "Make the request".

Expected result

{

"abusefiltercheckmatch": {
    "result": true
}

}

Actual result

{

"abusefiltercheckmatch": {
    "result": false
}

}

A similar test with e.g. the filter "user_name===null" and the same JSON in the vars field gives
{

"abusefiltercheckmatch": {
    "result": true
}

}

So, it seems AbuseFilter is not setting the variables properly.

Notes:

  1. If you don't have the appropriate user rights you'll see something like

{

"servedby": "mw1141",
"error": {
    "code": "unknownerror",
    "info": "Unknown error: \"permissiondenied\""
}

}

  1. In case I'm using the wrong syntax to test this, maybe this bug could be reused to request an improved documentation for this API?

Version: unspecified
Severity: normal
URL: https://pt.wikipedia.org/wiki/Especial:ApiSandbox#action=abusefiltercheckmatch&format=json&filter=length(user_name)%3E0&vars=%7B%22user_name%22%3A%22Foo%22%7D

Details

Reference
bz53501

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:00 AM
bzimport added a project: AbuseFilter.
bzimport set Reference to bz53501.
bzimport added a subscriber: Unknown Object (MLST).

Change 150456 had a related patch set uploaded by Helder.wiki:
Do not ignore the "vars" parameter on action=abusefiltercheckmatch

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

Change 150456 merged by jenkins-bot:
Do not ignore the "vars" parameter on action=abusefiltercheckmatch

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