From ea53e4c22f99ac563c708b8afcf66138d545f2d6 Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Tue, 17 Mar 2015 22:12:52 -0400 Subject: pfBlockerNG - Mods - Create Suppression File -Previous version would not clear old suppression file when Alias is empty. --- config/pfblockerng/pfblockerng.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc index cd4b856d..1a1c87a2 100644 --- a/config/pfblockerng/pfblockerng.inc +++ b/config/pfblockerng/pfblockerng.inc @@ -226,8 +226,11 @@ function pfb_create_suppression_file() { if ($pfb['found']) { $pfb_suppress = str_replace(" ", "\n", $config['aliases']['alias'][$pfb_id]['address']); - if (!empty($pfb_suppress)) + if (!empty($pfb_suppress)) { @file_put_contents("{$pfb['supptxt']}",$pfb_suppress, LOCK_EX); + } else { + unlink_if_exists("{$pfb['supptxt']}"); + } } else { # Delete Suppression File if Alias is Empty. unlink_if_exists("{$pfb['supptxt']}"); -- cgit v1.2.3