aboutsummaryrefslogtreecommitdiffstats
path: root/packages/squid
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
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')
-rw-r--r--packages/squid/squid.inc20
-rw-r--r--packages/squid/squid.xml4
2 files changed, 21 insertions, 3 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;
}
diff --git a/packages/squid/squid.xml b/packages/squid/squid.xml
index 9f138ed9..6bba018f 100644
--- a/packages/squid/squid.xml
+++ b/packages/squid/squid.xml
@@ -271,9 +271,9 @@
</options>
</field>
<field>
- <fielddescr>Use different DNS-servers for the proxy-server</fielddescr>
+ <fielddescr>Use alternate DNS-servers for the proxy-server</fielddescr>
<fieldname>dns_nameservers</fieldname>
- <description>If you want to use other DNS-servers than the DNS-forwarder, enter the IPs here separated by spaces.</description>
+ <description>If you want to use other DNS-servers than the DNS-forwarder, enter the IPs here, separated by semi-colons (;).</description>
<type>input</type>
<size>60</size>
</field>