Extension talk:AbuseFilter/Rules format

Jump to navigation Jump to search

About this board

19 previous topics. Previous discussion was archived at Extension talk:AbuseFilter/Rules format/Archive 1 on 2016-10-24.

Erutuon (talkcontribs)

I have a question about statements in the documentation about identifying new pages. I am an admin in the English Wiktionary. In the documentation for page_id and page_age, it seems to say that for new pages page_id may be 0 and page_age is always 0, but there were no matches for either condition (page_id == 0 or page_age == 0) in Special:AbuseFilter/test except for page deletions, whereas old_size == 0 yields a lot of edits that created pages (for which neither page_id nor page_age were equal to 0). Is the documentation wrong that page_id == 0 and page_age == 0 identify newly created pages or am I misinterpreting what it says somehow?

Ciencia Al Poder (talkcontribs)

page_id is a non-deterministic value that changes when the page is created. The filters are checked before the new page is assigned a new ID, hence the filter matches when the page is evaluated at the time of creation, but not when the page has already been created, because then the page already has an ID.

Erutuon (talkcontribs)

So basically the page creation actions seen in Special:AbuseFilter/test do not contain the actual value of page_id when the action occurred, the value that a filter will see when it is saved and in operation? And the same with page_age? That is not helpful because it does not allow Special:AbuseFilter/test to give a completely realistic picture of how a filter will work, as far as page_id is concerned. I would have expected to be searching a "snapshot" of the actual values when the action happened. But I suppose the workaround is to create a test filter.

Ciencia Al Poder (talkcontribs)

Yeah, that data is not saved. Probably because that would be a lot of information to store for each edit/action that doesn't match any filter. This is task T102944

Erutuon (talkcontribs)

Thanks for explaining this to me, and for posting about this on the Phabricator task.

Reply to "Identifying new pages"

Why was "minor_edit" removed and obsoleted?

Equinox (talkcontribs)

An explanation would be nice. Also what are we supposed to write instead, to get the same effect?

Matěj Suchánek (talkcontribs)
Daimona Eaytoy (talkcontribs)

Exactly. Moreover, I think (but I'm unsure where I may have heard this) it's also because there's little benefit in having minor_edit: it wouldn't mean much in many typical use cases for filters.

Ciencia Al Poder (talkcontribs)

Too bad it was requested in phab:T28636 and phab:T19674. However, I understand why it was removed, since it affects stashed edits.

The minor flag is not really meaningful, and if you want to enforce the minor edit flag (or lack of), you should implement your own validation with a hook

Reply to "Why was "minor_edit" removed and obsoleted?"

Adding link to PHP Regex Unicode documentation

Mys 721tx (talkcontribs)
Reply to "Adding link to PHP Regex Unicode documentation"
Erutuon (talkcontribs)

new_text is described incorrectly here (though not in Special:AbuseFilter). It's not the wikitext; it seems like Element.prototype.innerText in JavaScript: the characters in the rendering of the resulting HTML.

Daimona Eaytoy (talkcontribs)

@Erutuon You are correct, thanks for reporting this! I have fixed the error, which was caused by a message with a deceiving name.

Reply to "new_text"
Clump (talkcontribs)

Is there a concise list of canonical group names for use with the user_groups test? The documentation links to the list of group rights, but that table does not give a specific name to each group. For example, in existing filters I see "autopatrolled" used in testing user_groups, but in the linked page's list it is called "Autopatrollers", and refers to a code symbol "autopatrol". Clicking on the Autopatrollers link goes to the project "Autopatrolled users" page (via a redirect). That page refers to the "autopatrol group", which links to user list, wherein I can select "Autopatrollers" in a drop-down, showing a list of users with the group name "autopatroller"---the latter being the same syntax I can see on when looking at an individual user's rights.

So, how does one find the actual names usable in a user_group test? Is the best way to look at the sub-page name of Special:ListUsers? That seems quite awkward and indirect, so I'm hoping I just missed a more obvious list.

BTW, I also noted that "sysop" is sometimes used in filters, and it is a group according to the manual but it is not listed as a group in Special:ListGroupRights.

Billinghurst (talkcontribs)

Also look at the abuselog reports (test or real ) themselves for a spam filter will show what applies and where. Often easier than digging through the API.

Billinghurst (talkcontribs)

Oh, and the other cheat that I use is the gadget navigation popups will show a user's rights when you hover over a username, and it shows them at the underlying name.

Clump (talkcontribs)

Thanks, I hadn't enabled that gadget before, but it's quite useful.

MusikAnimal (talkcontribs)

All the group names at Special:ListGroupRights are localized, which is why you see "Autopatrollers" instead of "autopatrolled" (as specified by MediaWiki:Group-autopatrolled), and "Administrators" instead of "sysop" (MediaWiki:Group-sysop). The API can give you the full list with the raw system names: https://www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=usergroups (look for the "name": keys). It also lists the rights that each group has, which is what the user_rights variable would contain.

Clump (talkcontribs)

Awesome, thanks!

Reply to "user_groups names?"
Incnis Mrsi (talkcontribs)

Look at commons:Special:AbuseFilter/14. Are single equality signs near article_namespace a valid representation of the comparison operator in this context? Or it is a regrettable misspell by Commons sysops?

Zzuuzz (talkcontribs)

It does work (and always has) but is probably not what you'd consider good practice.

Reply to "Comparison operator"
There are no older topics