aboutsummaryrefslogtreecommitdiffstats
path: root/config/dnsblacklist/dnsblacklist.tmp
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-10-02 22:09:17 -0600
committermcrane <mctch@yahoo.com>2009-10-02 22:10:22 -0600
commitcb829a8ae1fd3267062710a0ddc93d5bf8a2592a (patch)
tree0b174dd73cd9d0e8a8ecc6e741916861e351d1ef /config/dnsblacklist/dnsblacklist.tmp
parent4985408990aa1d954be067d8d3368158df276b68 (diff)
downloadpfsense-packages-cb829a8ae1fd3267062710a0ddc93d5bf8a2592a.tar.gz
pfsense-packages-cb829a8ae1fd3267062710a0ddc93d5bf8a2592a.tar.bz2
pfsense-packages-cb829a8ae1fd3267062710a0ddc93d5bf8a2592a.zip
DNS Blacklist fix remove invisible character from domain list.
Diffstat (limited to 'config/dnsblacklist/dnsblacklist.tmp')
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp9
1 files changed, 8 insertions, 1 deletions
diff --git a/config/dnsblacklist/dnsblacklist.tmp b/config/dnsblacklist/dnsblacklist.tmp
index 6f80bc00..4edf4683 100644
--- a/config/dnsblacklist/dnsblacklist.tmp
+++ b/config/dnsblacklist/dnsblacklist.tmp
@@ -55,6 +55,9 @@
//}
if (count($_POST)>0) {
+
+ conf_mount_rw();
+
$dnsmasqfile = "/usr/local/etc/dnsmasq.conf";
$targetfile = "/usr/local/etc/dnsmasq.blacklist.conf";
$includestring = "conf-file=/usr/local/etc/dnsmasq.blacklist.conf";
@@ -104,7 +107,10 @@ if (count($_POST)>0) {
$fh2 = fopen($targetfile, 'a');
$fh = fopen($blackfile,'r');
while($line=fgets($fh)) {
- fwrite($fh2, "address=/" .trim($line). "/74.125.45.100". "\n");
+ //remove all characters other than alpha numeric period and dash
+ preg_match("/([a-zA-Z0-9.-]*)/i", $line, $arraymatches);
+ $line = $arraymatches[1];
+ fwrite($fh2, "address=/" .$line. "/74.125.45.100". "\n");
}
fclose($fh);
fclose($fh2);
@@ -115,6 +121,7 @@ if (count($_POST)>0) {
services_dnsmasq_configure();
sleep(1);
$savemsg_dnsb = "DNS Blacklist settings have been saved. Restart dnsmasq service under 'Status' then 'Services' to make the settings active.";
+ conf_mount_ro();
}
?>