diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 20:38:59 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-27 20:38:59 +0000 |
commit | b4b78c26029b72adef1d27b3217fdd22a2d5d8bb (patch) | |
tree | 8803b16d5c9ae2d6624c1e18eb3c1ad7afba7c3a /contrib | |
parent | 0fe67c367dee211667bd64dc6c615cde41ab4965 (diff) |
Separate multiple items encoded into a single field with ';'
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@126021 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/dbsep.cgi | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/scripts/dbsep.cgi b/contrib/scripts/dbsep.cgi index dd060f769..8010b21c3 100755 --- a/contrib/scripts/dbsep.cgi +++ b/contrib/scripts/dbsep.cgi @@ -57,7 +57,9 @@ if ($mode eq 'single') { $sth->execute() || throw_error("Invalid query: $sql"); $row = $sth->fetchrow_hashref(); foreach (keys %$row) { - push @answer, encode($_) . "=" . encode($row->{$_}); + foreach my $item (split /\;/, $row->{$_}) { + push @answer, encode($_) . "=" . encode($item); + } } $sth->finish(); $dbh->disconnect(); @@ -74,7 +76,9 @@ if ($mode eq 'single') { while (my $row = $sth->fetchrow_hashref()) { @answer = (); foreach (keys %$row) { - push @answer, encode($_) . "=" . encode($row->{$_}); + foreach my $item (split /\;/, $row->{$_}) { + push @answer, encode($_) . "=" . encode($item); + } } print join("&", @answer) . "\n"; } |