Check tags with ChangeTags::canCreateTag

These are also user-provided tag names, so should be checked with
ChangeTags::canCreateTag, which is intended for that purpose.

This check also applies on edits.

Bug: T164133
Change-Id: Iaf161d538f225a86c7abf8a8a347de9169d781bf
This commit is contained in:
Matthew Flaschen 2017-05-08 20:30:39 -04:00
parent 0aaae3eec3
commit 5e2e4849b3

View file

@ -111,7 +111,9 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$bad = false;
foreach ( $actions['tag']['parameters'] as $tag ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, 'tag-' . $tag );
if ( !$t ) {
if ( !$t ||
!ChangeTags::canCreateTag( $tag, $user )->isOK() ) {
$bad = true;
}