From e41378d5987a91855468300713fbb71012064a7b Mon Sep 17 00:00:00 2001 From: Luke Reeves Date: Tue, 14 Jul 2009 21:37:50 -0400 Subject: [PATCH] Fix for proxy_host option --- lib/Insipid/Main.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 -- 2.39.5