From 56392994c792423080948f086ac01a95670173f8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 3 Oct 2006 15:57:00 +0000 Subject: Writeout whitelist with a foreach, ensure that no stray spaces are present. --- packages/snort/snort.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages/snort') 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); -- cgit v1.2.3