aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-10-03 15:57:00 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-10-03 15:57:00 +0000
commit56392994c792423080948f086ac01a95670173f8 (patch)
tree8cb980c5ffec68f5363927852218874a09311cc5
parentd0471f35747991059b2c04f7b8e8ab46fefe3431 (diff)
downloadpfsense-packages-56392994c792423080948f086ac01a95670173f8.tar.gz
pfsense-packages-56392994c792423080948f086ac01a95670173f8.tar.bz2
pfsense-packages-56392994c792423080948f086ac01a95670173f8.zip
Writeout whitelist with a foreach, ensure that no stray spaces are present.
-rw-r--r--packages/snort/snort.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc
index e27d8e4a..08ae54bc 100644
--- a/packages/snort/snort.inc
+++ b/packages/snort/snort.inc
@@ -186,7 +186,11 @@ function generate_snort_conf() {
/* write out whitelist, convert spaces to carriage returns */
$whitelist_home_net = str_replace(" ", "\n", $home_net);
- fwrite($whitelist, $whitelist_home_net);
+ /* foreach through whitelist, writing out to file */
+ $whitelist_split = split("\n", $whitelist_home_net);
+ foreach(whitelist_split as $wl)
+ if(trim($wl))
+ fwrite($whitelist, trim($wl) . "\n");
/* close file */
fclose($whitelist);