From d9100d29361bffdf41e25d02b09a3fc510aeafac Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 19 Mar 2006 23:40:27 +0000 Subject: Delete items correctly when they are an ip address --- packages/spamd_db.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/spamd_db.php b/packages/spamd_db.php index fe54e7ae..25ef4ab3 100644 --- a/packages/spamd_db.php +++ b/packages/spamd_db.php @@ -52,14 +52,17 @@ if($_GET['action'] or $_POST['action']) { $srcip = $_GET['srcip']; if($_POST['srcip']) $srcip = $_POST['srcip']; + $srcip = str_replace("<","",$srcip); + $srcip = str_replace(">","",$srcip); + $srcip = str_replace(" ","",$srcip); /* execute spamdb command */ if($action == "whitelist") { exec("echo spamdb -a {$srcip} > /tmp/tmp"); exec("/usr/local/sbin/spamdb -a {$srcip}"); } else if($action == "delete") { exec("/usr/local/sbin/spamdb -d {$srcip}"); - exec("/usr/local/sbin/spamdb -d -T \"<{$srcip}>\""); - exec("/usr/local/sbin/spamdb -d -t \"<{$srcip}>\""); + exec("/usr/local/sbin/spamdb -d \"<{$srcip}>\" -T"); + exec("/usr/local/sbin/spamdb -d \"<{$srcip}>\" -t"); } else if($action == "spamtrap") { exec("/usr/local/sbin/spamdb -a {$srcip} -T"); } else if($action == "trapped") { -- cgit v1.2.3