}
// to be applied, a tag has to be explicitly defined
- // @todo Allow extensions to define tags that can be applied by users...
$allowedTags = self::listExplicitlyDefinedTags();
+ Hooks::run( 'ChangeTagsAllowedAdd', [ &$allowedTags, $tags, $user ] );
$disallowedTags = array_diff( $tags, $allowedTags );
if ( $disallowedTags ) {
return self::restrictedTagError( 'tags-apply-not-allowed-one',
$tables[] = 'change_tag';
$join_conds['change_tag'] = [ 'INNER JOIN', $join_cond ];
- $conds['ct_tag'] = explode( ',', $filter_tag );
+ $conds['ct_tag'] = explode( '|', $filter_tag );
}
}
return Status::newFatal( 'tags-create-no-name' );
}
- // tags cannot contain commas (used as a delimiter in tag_summary table) or
- // slashes (would break tag description messages in MediaWiki namespace)
- if ( strpos( $tag, ',' ) !== false || strpos( $tag, '/' ) !== false ) {
+ // tags cannot contain commas (used as a delimiter in tag_summary table),
+ // pipe (used as a delimiter between multiple tags in
+ // modifyDisplayQuery), or slashes (would break tag description messages in
+ // MediaWiki namespace)
+ if ( strpos( $tag, ',' ) !== false || strpos( $tag, '|' ) !== false
+ || strpos( $tag, '/' ) !== false ) {
return Status::newFatal( 'tags-create-invalid-chars' );
}