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:
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:
// 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 ); } }