aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBBcan177 <bbcan177@gmail.com>2015-03-17 22:12:52 -0400
committerBBcan177 <bbcan177@gmail.com>2015-03-17 22:12:52 -0400
commitea53e4c22f99ac563c708b8afcf66138d545f2d6 (patch)
treef1dafb05412dcf5d680f2aa6272af532eea8ba34 /config
parentc4a18b2d6253afd36491498b3e92c5f131e9b5ee (diff)
downloadpfsense-packages-ea53e4c22f99ac563c708b8afcf66138d545f2d6.tar.gz
pfsense-packages-ea53e4c22f99ac563c708b8afcf66138d545f2d6.tar.bz2
pfsense-packages-ea53e4c22f99ac563c708b8afcf66138d545f2d6.zip
pfBlockerNG - Mods - Create Suppression File
-Previous version would not clear old suppression file when Alias is empty.
Diffstat (limited to 'config')
-rw-r--r--config/pfblockerng/pfblockerng.inc5
1 files changed, 4 insertions, 1 deletions
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']}");