diff --git a/bin/rt.in b/bin/rt.in index 6ca302e19a5..280af51a8e4 100755 --- a/bin/rt.in +++ b/bin/rt.in @@ -1514,7 +1514,7 @@ sub vsplit { # XXX: This should become a real parser, à la Text::ParseWords. $line =~ s/^\s+//; $line =~ s/\s+$//; - my ( $a, $b ) = split /,/, $line, 2; + my ( $a, $b ) = split /\s*,\s*/, $line, 2; while ($a) { no warnings 'uninitialized'; @@ -1522,7 +1522,7 @@ sub vsplit { my $s = $a; while ( $a !~ /'$/ || ( $a !~ /(\\\\)+'$/ && $a =~ /(\\)+'$/ )) { - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; $s .= ',' . $a; } push @words, $s; @@ -1531,7 +1531,7 @@ sub vsplit { my $s = $a; while ( $a !~ /}$/ ) { ( $a, $b ) = - split /,/, $b, 2; + split /\s*,\s*/, $b, 2; $s .= ',' . $a; } $s =~ s/^q{/'/; @@ -1541,7 +1541,7 @@ sub vsplit { else { push @words, $a; } - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; } @@ -1556,7 +1556,7 @@ sub expand_list { my ($list) = @_; my @elts; - foreach (split /,/, $list) { + foreach (split /\s*,\s*/, $list) { push @elts, /^(\d+)-(\d+)$/? ($1..$2): $_; } diff --git a/lib/RT/Interface/REST.pm b/lib/RT/Interface/REST.pm index 98e475b51fa..c7868321cdc 100755 --- a/lib/RT/Interface/REST.pm +++ b/lib/RT/Interface/REST.pm @@ -94,7 +94,7 @@ sub expand_list { my ($list) = @_; my @elts; - foreach (split /,/, $list) { + foreach (split /\s*,\s*/, $list) { push @elts, /^(\d+)-(\d+)$/? ($1..$2): $_; } diff --git a/share/html/REST/1.0/Forms/ticket/default b/share/html/REST/1.0/Forms/ticket/default index b82cb5ed620..4f20d901d31 100755 --- a/share/html/REST/1.0/Forms/ticket/default +++ b/share/html/REST/1.0/Forms/ticket/default @@ -368,14 +368,14 @@ else { } else { my @new; - my ( $a, $b ) = split /,/, $val, 2; + my ( $a, $b ) = split /\s*,\s*/, $val, 2; while ($a) { no warnings 'uninitialized'; if ( $a =~ /^'/ ) { my $s = $a; while ( $a !~ /'$/ || ( $a !~ /(\\\\)+'$/ && $a =~ /(\\)+'$/ ) ) { - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; $s .= ',' . $a; } $s =~ s/^'//; @@ -386,7 +386,7 @@ else { elsif ( $a =~ /^q{/ ) { my $s = $a; while ( $a !~ /}$/ ) { - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; $s .= ',' . $a; } $s =~ s/^q{//; @@ -396,7 +396,7 @@ else { else { push @new, $a; } - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; } my %new; diff --git a/share/html/REST/1.0/dhandler b/share/html/REST/1.0/dhandler index 085bbb3042c..a8dcdba29c5 100755 --- a/share/html/REST/1.0/dhandler +++ b/share/html/REST/1.0/dhandler @@ -210,7 +210,7 @@ if ($fields) { $output = "Invalid field specification: $fields"; goto OUTPUT; } - @fields = map lc, split /,/, $fields; + @fields = map lc, split /\s*,\s*/, $fields; @fields{@fields} = (); unless (exists $fields{id}) { unshift @fields, "id"; diff --git a/share/html/REST/1.0/search/ticket b/share/html/REST/1.0/search/ticket index 46eb5ffcf18..84529ac78d0 100755 --- a/share/html/REST/1.0/search/ticket +++ b/share/html/REST/1.0/search/ticket @@ -69,7 +69,7 @@ if ($fields) { $output = "Invalid field specification: $fields"; goto OUTPUT; } - @fields = map lc, split /,/, $fields; + @fields = map lc, split /\s*,\s*/, $fields; @fields{@fields} = (); unless (exists $fields{id}) { unshift @fields, "id";