]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1191510: Tags with spaces in them are incorrectly split into several tags
authorFrédéric Buclin <LpSolit@gmail.com>
Thu, 6 Aug 2015 15:04:28 +0000 (17:04 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Thu, 6 Aug 2015 15:04:28 +0000 (17:04 +0200)
r=gerv a=dkl

process_bug.cgi

index 3deeb5f2e5e5a26884743b227010de02b8f7256c..6ed15a0670cf455512a8e5dc638b895b18f0d359 100755 (executable)
@@ -352,7 +352,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;