Skip to content

Commit

Permalink
firewall: port can be zero in automatic rule, render accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Nov 9, 2023
1 parent d1006d4 commit 3e380ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php
Expand Up @@ -329,7 +329,7 @@ public function isUIFromNot()
}
public function getUIFromPort()
{
if (!empty($this->rule['from_port'])) {
if (isset($this->rule['from_port']) && $this->rule['from_port'] != '') {
return $this->rule['from_port'];
} elseif (isset($this->rule['source']['port'])) {
return $this->rule['source']['port'];
Expand All @@ -355,7 +355,7 @@ public function isUIToNot()
}
public function getUIToPort()
{
if (!empty($this->rule['to_port'])) {
if (isset($this->rule['to_port']) && $this->rule['to_port'] != '') {
return $this->rule['to_port'];
} elseif (isset($this->rule['destination']['port'])) {
return $this->rule['destination']['port'];
Expand Down

0 comments on commit 3e380ff

Please sign in to comment.