From f83fa942920b3ef8cd23f35ad3237985b895a1eb Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 13 May 2010 18:56:07 +0000 Subject: [PATCH] Test correctly for previous existing entries of linked rules otherwise some bad deletions might happen. Reported-by: http://forum.pfsense.org/index.php/topic,25091.0.html --- usr/local/www/firewall_nat_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index d840d3508a..2b415ecaeb 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -316,7 +316,7 @@ if ($_POST) { unset($natent['nosync']); // If we used to have an associated filter rule, but no-longer should have one - if ($a_nat[$id]>0 && ( empty($natent['associated-rule-id']) || $natent['associated-rule-id'] != $a_nat[$id]['associated-rule-id'] ) ) { + if (!empty($a_nat[$id]) && ( empty($natent['associated-rule-id']) || $natent['associated-rule-id'] != $a_nat[$id]['associated-rule-id'] ) ) { // Delete the previous rule delete_id($a_nat[$id]['associated-rule-id'], $config['filter']['rule']); mark_subsystem_dirty('filter');