From be624266bf94dfc4124fdeb5406f74cb8f2e66d9 Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Fri, 29 Jan 2016 08:59:23 -0500 Subject: Fixed issues where a rule is duplicated (cloned) and the new rule is inserted above a separator bar location --- src/usr/local/www/firewall_nat_edit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/usr/local/www/firewall_nat_edit.php') diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index 2ffbcad..2165a32 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -521,7 +521,11 @@ if ($_POST) { for ($idx=0; isset($a_separators['sep' . $idx]); $idx++ ) { $seprow = substr($a_separators['sep' . $idx]['row']['0'], 2); - $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow + 1); + + // If the separator is located after the place where the new rule is to go, increment the separator row + if ($seprow > $after) { + $a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow + 1); + } } } else { $a_nat[] = $natent; -- cgit v1.1