aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid/squid.inc
diff options
context:
space:
mode:
authorMartin Fuchs <mfuchs@pfsense.org>2008-08-12 13:08:22 +0000
committerMartin Fuchs <mfuchs@pfsense.org>2008-08-12 13:08:22 +0000
commit93627c7dfc5af6dfd9a0175800aa0fdd6986fbe3 (patch)
tree4009c3f9ecc336624ac9074e1528dd5652a964a5 /packages/squid/squid.inc
parent6eeedbf0cd8e94fee263b8349d28c2b040a2b97d (diff)
downloadpfsense-packages-93627c7dfc5af6dfd9a0175800aa0fdd6986fbe3.tar.gz
pfsense-packages-93627c7dfc5af6dfd9a0175800aa0fdd6986fbe3.tar.bz2
pfsense-packages-93627c7dfc5af6dfd9a0175800aa0fdd6986fbe3.zip
input validation for: checkin 24421
Diffstat (limited to 'packages/squid/squid.inc')
-rw-r--r--packages/squid/squid.inc20
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc
index 05eb144e..674f38cd 100644
--- a/packages/squid/squid.inc
+++ b/packages/squid/squid.inc
@@ -312,6 +312,15 @@ function squid_validate_general($post, $input_errors) {
$input_errors[] = "You can not enable forwarding traffic to private subnets to the proxy server without using the transparent proxy.";
}
+ if(!empty($post['dns_nameservers'])) {
+ $altdns = explode(";", ($post['dns_nameservers']));
+// $conf .= "# Custom options\n";
+ foreach ($altdns as $dnssrv) {
+// $conf .= $custopt."\n";
+ if (!is_ipaddr($dnssrv))
+ $input_errors[] = 'You must enter a valid IP address in the \'Alternate DNS servers\' field';
+ }}
+
}
function squid_validate_upstream($post, $input_errors) {
@@ -533,7 +542,16 @@ EOD;
if ($settings['disable_xforward']) $conf .= "forwarded_for off\n";
if ($settings['disable_via']) $conf .= "via off\n";
$conf .= "uri_whitespace {$settings['uri_whitespace']}\n";
- if (!empty($settings['dns_nameservers'])) $conf .= "dns_nameservers {$settings['dns_nameservers']}\n";
+
+ if(!empty($settings['dns_nameservers'])) {
+ $altdns = explode(";", ($settings['dns_nameservers']));
+ $conf .= "dns_nameservers ";
+ foreach ($altdns as $dnssrv) {
+ $conf .= $dnssrv." ";
+ }
+// $conf .= "\n";
+ }
+
return $conf;
}