summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-06-27 20:38:59 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-06-27 20:38:59 +0000
commited553a7c778acc1a19b4c8a590549e54a65c9386 (patch)
tree8803b16d5c9ae2d6624c1e18eb3c1ad7afba7c3a /contrib
parentd4ddf14b6b7cbd10d7392d58ae41c9f6f37c6e15 (diff)
Separate multiple items encoded into a single field with ';'
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/dbsep.cgi8
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";
}