From: Luke Reeves Date: Wed, 15 Jul 2009 01:37:50 +0000 (-0400) Subject: Fix for proxy_host option X-Git-Tag: 2.1-alpha-2019-0-29~148 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=e41378d5987a91855468300713fbb71012064a7b;p=insipid.git Fix for proxy_host option --- diff --git a/lib/Insipid/Main.pm b/lib/Insipid/Main.pm index de1ed0a..3e3be57 100755 --- a/lib/Insipid/Main.pm +++ b/lib/Insipid/Main.pm @@ -460,7 +460,9 @@ sub show_options { # Save options if they were posted. print "

"; if(param('save')) { - print "
Your options have been saved.
"; + my $sql = "update $tbl_options set value=? + where (name = ?)"; + my $sth = $dbh->prepare($sql); my %save; foreach my $p (@valid) { @@ -470,11 +472,15 @@ sub show_options { } foreach my $k (keys %save) { - my $sql = "update $tbl_options set value=? - where (name = ?)"; - my $sth = $dbh->prepare($sql); $sth->execute($save{$k}, $k); } + + # The proxy_host can be empty, so check for that. + if(!defined($save{'proxy_host'})) { + $sth->execute('', 'proxy_host'); + } + + print "
Your options have been saved.
"; } # Now show em