Skip to content

Commit

Permalink
firewall: preg_replace() nibbles away our non-catpure group; closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Dec 7, 2023
1 parent 39c1b35 commit 52f3939
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
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private function uiConvertNet($network)
public function getUIFromAddress()
{
if (!empty($this->rule['from'])) {
return preg_replace('/,(?:[^\s])/', ', ', $this->rule['from']);
return preg_replace('/,(?=[^\s])/', ', ', $this->rule['from']);
} elseif (isset($this->rule['source']['address'])) {
return $this->rule['source']['address'];
} elseif (isset($this->rule['source']['any'])) {
Expand All @@ -339,7 +339,7 @@ public function getUIFromPort()
public function getUIToAddress()
{
if (!empty($this->rule['to'])) {
return preg_replace('/,(?:[^\s])/', ', ', $this->rule['to']);
return preg_replace('/,(?=[^\s])/', ', ', $this->rule['to']);
} elseif (isset($this->rule['destination']['address'])) {
return $this->rule['destination']['address'];
} elseif (isset($this->rule['destination']['any'])) {
Expand Down

0 comments on commit 52f3939

Please sign in to comment.