Edit filter configuration

Differences between versions

ItemVersion from 23:02, 11 April 2024 by Suffusion of YellowVersion from 17:15, 12 April 2024 by Suffusion of Yellow
Basic information
Notes:
Warn or disallow filter checking for the same strings as [[Special:AbuseFilter/631]]. 631 shouldn't be set to warn or disallow, because it often catches accidental insertions accompanying good edits. This one checks for edits that add toolbar markup and do nothing else. Still should perhaps use a less BITEy message than [[MediaWiki:Abusefilter-warning]]. --Suffusion of Yellow 19:17 11 Apr 2024
Warn or disallow filter checking for the same strings as [[Special:AbuseFilter/631]]. 631 shouldn't be set to warn or disallow, because it often catches accidental insertions accompanying good edits. This one checks for edits that add toolbar markup and do nothing else. Still should perhaps use a less BITEy message than [[MediaWiki:Abusefilter-warning]]. --Suffusion of Yellow 19:17 11 Apr 2024
Fix unescaped # (how did that work?), add linebreaks to the regex to make it clear that the (?x) still applies. --Suffusion of Yellow 17:15 12 Apr 2024
Filter conditions
Conditions:
(documentation)
!("confirmed" in user_groups) &
!("confirmed" in user_groups) &
page_namespace === 0 &
page_namespace === 0 &
(
(
toolbar := "(?x)
toolbar := "(?x)
         '''Bold[ ]text'''
         '''Bold[ ]text'''
         |''Italic[ ]text''
         |''Italic[ ]text''
         |\[\[\|thumb\]\]
         |\[\[\|thumb\]\]
         |<gallery>[\n]Example\.jpg
         |<gallery>[\n]Example\.jpg
         |<ref></ref>
         |<ref></ref>
         |==[ ]Heading[ ]text[ ]==
         |==[ ]Heading[ ]text[ ]==
         |\*[ ]Bulleted[ ]list[ ]item
         |\*[ ]Bulleted[ ]list[ ]item
         |\#[ ]Numbered[ ]list[ ]item
         |\#[ ]Numbered[ ]list[ ]item
         |<big>Big[ ]text
         |<big>Big[ ]text
         |<small>Small[ ]text
         |<small>Small[ ]text
         |<sup>Superscript[ ]text
         |<sup>Superscript[ ]text
         |<sub>Subscript[ ]text
         |<sub>Subscript[ ]text
         |<nowiki>Insert[ ]non-formatted[ ]text[ ]here
         |<nowiki>Insert[ ]non-formatted[ ]text[ ]here
         |![ ]Header[ ]text
         |![ ]Header[ ]text
         |[#]REDIRECT[ ]\[\[Target[ ]page[ ]name\]\]
         |[#]REDIRECT[ ]\[\[Target[ ]page[ ]name\]\]
     ";
     ";


     /* When people stab the buttons repeatedly, the results can end up nested, e.g. <ref><small>Small text</small></ref> */
     /* When people stab the buttons repeatedly, the results can end up nested, e.g. <ref><small>Small text</small></ref> */
     trim := toolbar + "|</?sub>|</?sup>|</?small>|</?ref>|</?nowiki>|#REDIRECT";
     trim := toolbar + "
        |</?sub>
        |</?sup>
        |</?small>
        |</?ref>
        |</?nowiki>
        |[#]REDIRECT
    ";


     added_lines rlike toolbar &
     added_lines rlike toolbar &
     !(removed_lines rlike toolbar) &
     !(removed_lines rlike toolbar) &
     rmwhitespace(rmspecials(str_replace_regexp(added_lines, trim, ""))) == rmwhitespace(rmspecials(str_replace_regexp(removed_lines, trim, "")))
     rmwhitespace(rmspecials(str_replace_regexp(added_lines, trim, ""))) == rmwhitespace(rmspecials(str_replace_regexp(removed_lines, trim, "")))
)
)