]> 91.132.146.200 Git - insipid.git/commitdiff
Fix for proxy_host option
authorLuke Reeves <luke@neuro-tech.net>
Wed, 15 Jul 2009 01:37:50 +0000 (21:37 -0400)
committerLuke Reeves <luke@neuro-tech.net>
Wed, 15 Jul 2009 01:37:50 +0000 (21:37 -0400)
lib/Insipid/Main.pm

index de1ed0a2ce3dadf49799428a0f4368b43a1e49b1..3e3be5728c4cc33bca1e7a1fc106195f4e58423f 100755 (executable)
@@ -460,7 +460,9 @@ sub show_options {
        # Save options if they were posted.\r
        print "<br /><br />";\r
        if(param('save')) {\r
-               print "<div class=\"error\">Your options have been saved.</div>";\r
+               my $sql = "update $tbl_options set value=? \r
+                       where (name = ?)";\r
+               my $sth = $dbh->prepare($sql);\r
 \r
                my %save;\r
                foreach my $p (@valid) {\r
@@ -470,11 +472,15 @@ sub show_options {
                }\r
 \r
                foreach my $k (keys %save) {\r
-                       my $sql = "update $tbl_options set value=? \r
-                               where (name = ?)";\r
-                       my $sth = $dbh->prepare($sql);\r
                        $sth->execute($save{$k}, $k);\r
                }\r
+\r
+               # The proxy_host can be empty, so check for that.\r
+               if(!defined($save{'proxy_host'})) {\r
+                       $sth->execute('', 'proxy_host');\r
+               }\r
+\r
+               print "<div class=\"error\">Your options have been saved.</div>";\r
        }\r
 \r
        # Now show em\r