mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
firewall/rule parser, better to switch fetchActualRules() to a generator.
This commit is contained in:
parent
6628d7f495
commit
280781b582
@ -158,7 +158,6 @@ class FilterRule extends Rule
|
||||
*/
|
||||
private function fetchActualRules()
|
||||
{
|
||||
$result = array();
|
||||
$interfaces = empty($this->rule['interface']) ? array(null) : explode(',', $this->rule['interface']);
|
||||
foreach ($interfaces as $interface) {
|
||||
if (isset($this->rule['ipprotocol']) && $this->rule['ipprotocol'] == 'inet46') {
|
||||
@ -255,10 +254,9 @@ class FilterRule extends Rule
|
||||
&& isset($tmp['set-prio-low']) && $tmp['set-prio-low'] !== "" ) {
|
||||
$tmp['set-prio'] = "({$tmp['set-prio']}, {$tmp['set-prio-low']})";
|
||||
}
|
||||
$result[] = $tmp;
|
||||
yield $tmp;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user