[asterisk-commits] tilghman: trunk r126021 - /trunk/contrib/scripts/dbsep.cgi

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 27 15:38:59 CDT 2008


Author: tilghman
Date: Fri Jun 27 15:38:59 2008
New Revision: 126021

URL: http://svn.digium.com/view/asterisk?view=rev&rev=126021
Log:
Separate multiple items encoded into a single field with ';'

Modified:
    trunk/contrib/scripts/dbsep.cgi

Modified: trunk/contrib/scripts/dbsep.cgi
URL: http://svn.digium.com/view/asterisk/trunk/contrib/scripts/dbsep.cgi?view=diff&rev=126021&r1=126020&r2=126021
==============================================================================
--- trunk/contrib/scripts/dbsep.cgi (original)
+++ trunk/contrib/scripts/dbsep.cgi Fri Jun 27 15:38:59 2008
@@ -57,7 +57,9 @@
 	$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 @@
 	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";
 	}




More information about the asterisk-commits mailing list