From: Frédéric Buclin Date: Thu, 6 Aug 2015 15:05:50 +0000 (+0200) Subject: Bug 1191510: Tags with spaces in them are incorrectly split into several tags X-Git-Tag: release-5.0.1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7a85a445c156351c78a1b5dabbd5c7993078934;p=thirdparty%2Fbugzilla.git Bug 1191510: Tags with spaces in them are incorrectly split into several tags r=gerv a=dkl --- diff --git a/process_bug.cgi b/process_bug.cgi index b3ed2d36aa..216dfbf1b2 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -348,7 +348,7 @@ if (defined $cgi->param('id')) { # Tags can only be set to one bug at once. if (should_set('tag')) { - my @new_tags = split(/[\s,]+/, $cgi->param('tag')); + my @new_tags = grep { trim($_) } split(/,/, $cgi->param('tag')); my ($tags_removed, $tags_added) = diff_arrays($first_bug->tags, \@new_tags); $first_bug->remove_tag($_) foreach @$tags_removed; $first_bug->add_tag($_) foreach @$tags_added;