From: Tilghman Lesher Date: Fri, 27 Jun 2008 20:38:59 +0000 (+0000) Subject: Separate multiple items encoded into a single field with ';' X-Git-Tag: 1.6.2.0-beta1~1866 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed553a7c778acc1a19b4c8a590549e54a65c9386;p=thirdparty%2Fasterisk.git 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 --- diff --git a/contrib/scripts/dbsep.cgi b/contrib/scripts/dbsep.cgi index dd060f7694..8010b21c35 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"; }