Page MenuHomePhabricator

Unable to remove manually applied tags used by edit filters
Open, Needs TriagePublicBUG REPORT

Description

Steps to reproduce:
Attempt to remove the repeating characters tag from revisions at https://www.mediawiki.org/w/index.php?title=MediaWiki&action=history (added by a vandal)

Expected result:
Can remove, since https://www.mediawiki.org/wiki/Special:Tags confirms that the tag can be Applied manually by users and bots (also applied automatically by the abuse filter though)

Actual result:
Cannot be removed - tags-update-remove-not-allowed-one is shown

Cause:

ChangeTags::canUpdateTags
if ( $tagsToRemove ) {
	// to be removed, a tag must not be defined by an extension, or equivalently it
	// has to be either explicitly defined or not defined at all
	// (assuming no edge case of a tag both explicitly-defined and extension-defined)
	$softwareDefinedTags = self::listSoftwareDefinedTags();
	$intersect = array_intersect( $tagsToRemove, $softwareDefinedTags );
	if ( $intersect ) {
		return self::restrictedTagError( 'tags-update-remove-not-allowed-one',
			'tags-update-remove-not-allowed-multi', $intersect );
	}
}

This assumption dates back to when the functionality was first introduced in T20670: Create ability to add / remove tags from edits / actions. Original code:

Original
// to be removed, a tag has to be either explicitly defined or not defined
// at all
$definedTags = self::listDefinedTags();
$diff = array_diff( $tagsToRemove, $explicitlyDefinedTags );
if ( $diff ) {
	$intersect = array_intersect( $diff, $definedTags );
	if ( $intersect ) {
		return self::restrictedTagError( 'tags-update-remove-not-allowed-one',
			'tags-update-remove-not-allowed-multi', $intersect );
	}
}

@TTO @Anomie this edge case appears to have emerged

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 moved this task from Backlog to Change tags on the AbuseFilter board.

Tried to remove the no head temp tag from the most recent 4 edits of sniggered on English Wiktionary and got The changes could not be applied: The tag "no head temp" is not allowed to be removed. The tag is added by abuse filter 68 (in Special:Tags, it's "Defined by the software", "Applied manually by users and bots") so it's the same case as the original posting here.

This is an annoyance because I'm using the tag to track dictionary entries with a particular type of error in Wiktionary:missing headword-line templates. sniggered showed up in the page, even though its text doesn't match the abuse filter regex (that is, the last column of the table, showing the incorrect part of the entry, is empty).

In addition to this bug being fixed, I wish it were possible to put some kind of protection (autoconfirmed?) on this tag and on some others added by abuse filters, so that vandals can't add them but more reliable users can, but that doesn't seem to be supported. New users being able to add tags is a nice invitation for creative vandals. There are about 190 tag-related vandalism entries in English Wiktionary's tag log because several of our tags can be manually added as well as added by abuse filters.