summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/etc/inc/filter.inc4
-rw-r--r--src/usr/local/www/firewall_rules_edit.php2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc
index f41c091..9dea90a 100644
--- a/src/etc/inc/filter.inc
+++ b/src/etc/inc/filter.inc
@@ -4240,6 +4240,10 @@ function filter_get_antilockout_ports($wantarray = false) {
function ifridx($if, $ridx) {
global $config;
+ if ($ridx < 0) {
+ return $ridx;
+ }
+
$i = $ifridx = 0;
foreach ($config['filter']['rule'] as $rulen => $filterent) {
if (($filterent['interface'] == $if && !isset($filterent['floating'])) || (isset($filterent['floating']) && "FloatingRules" == $if)) {
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index cdd33c3..85ec11f 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -923,7 +923,7 @@ if ($_POST) {
$seprow = substr($a_separators['sep' . $idx]['row']['0'], 2);
// If the separator is located after the place where the new rule is to go, increment the separator row
- if (($seprow > $ifridx) || ($after == -1)) {
+ if ($seprow > $ifridx) {
$a_separators['sep' . $idx]['row']['0'] = 'fr' . ($seprow + 1);
}
}
OpenPOWER on IntegriCloud