Skip to content

Commit

Permalink
os-firewall: parse error on invert options. "not" is treated being se…
Browse files Browse the repository at this point in the history
…t or unset in core.

opnsense#1720
  • Loading branch information
AdSchellevis committed Mar 12, 2020
1 parent 64f3ed9 commit f2baaed
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ public function serialize()
$result['source'] = array();
if (!empty((string)$this->source_net)) {
$result['source']['network'] = (string)$this->source_net;
$result['source']['not'] = !empty((string)$this->source_not);
if (!empty((string)$this->source_not)) {
$result['source']['not'] = true;
}
if (!empty((string)$this->source_port)) {
$result['source']['port'] = (string)$this->source_port;
}
}
$result['destination'] = array();
if (!empty((string)$this->destination_net)) {
$result['destination']['network'] = (string)$this->destination_net;
$result['destination']['not'] = !empty((string)$this->destination_not);
if (!empty((string)$this->destination_not)) {
$result['destination']['not'] = true;
}
if (!empty((string)$this->source_port)) {
$result['destination']['port'] = (string)$this->destination_port;
}
Expand Down

0 comments on commit f2baaed

Please sign in to comment.