diff options
author | NOYB <Al_Stu@Frontier.com> | 2016-02-10 15:00:25 -0800 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-02-10 19:01:06 -0500 |
commit | 75d448048444582445d20898c99f4a61b30d7b6a (patch) | |
tree | 6d49f9a5679271e5b6a1115131e8aabf6ce2c5bc /src | |
parent | 4fe66748bcb2d63ba296d5f0ab891ce598db7793 (diff) | |
download | pfsense-75d448048444582445d20898c99f4a61b30d7b6a.zip pfsense-75d448048444582445d20898c99f4a61b30d7b6a.tar.gz |
Add is_array test and change !empty test to is_array test.
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/filter.inc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index e16b35d..9775f04 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -4243,21 +4243,23 @@ function ifridx($if, $ridx) { } $i = $ifridx = 0; - foreach ($config['filter']['rule'] as $rulen => $filterent) { - if (($filterent['interface'] == $if && !isset($filterent['floating'])) || (isset($filterent['floating']) && "FloatingRules" == $if)) { - if ($i == $ridx) { - return $ifridx; + if (is_array($config['filter']['rule'])) { + foreach ($config['filter']['rule'] as $rulen => $filterent) { + if (($filterent['interface'] == $if && !isset($filterent['floating'])) || (isset($filterent['floating']) && "FloatingRules" == $if)) { + if ($i == $ridx) { + return $ifridx; + } + $ifridx++; } - $ifridx++; + $i++; } - $i++; } return $i; } /* display rules separators */ function display_separator($separators, $nrules, $columns_in_table) { - if (!empty($separators)) { + if (is_array($separators)) { foreach ($separators as $sepn => $separator) { if ($separator['row'][0] == "fr" . $nrules) { $cellcolor = $separator['color']; |