Skip to content

Commit

Permalink
Support parentheses and negation in pf.conf macro values
Browse files Browse the repository at this point in the history
  • Loading branch information
sonertari committed May 8, 2022
1 parent 84c04c6 commit a8a8af4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/Model/lib/Macro.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ function sanitize()
{
$this->str= preg_replace('/{/', ' { ', $this->str);
$this->str= preg_replace('/}/', ' } ', $this->str);
$this->str= preg_replace('/\(/', ' ( ', $this->str);
$this->str= preg_replace('/\)/', ' ) ', $this->str);
$this->str= preg_replace('/,/', ' , ', $this->str);
$this->str= preg_replace('/=/', ' = ', $this->str);
$this->str= preg_replace('/"/', '', $this->str);
Expand Down
2 changes: 1 addition & 1 deletion src/Model/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$RE_MACRO_VAR= '\$' . $RE_ID;

/// @todo What are possible macro values?
define('RE_MACRO_VALUE', '^((\w|\$)[\w_.\/\-*]{0,49}|)$');
define('RE_MACRO_VALUE', '^((\w|\$|\(|!)[\w_.\/\-*\(\)]{0,49}|)$');

$RE_IF_NAME= '\w{1,20}';
$RE_IF_MODIF= '(|:(0|broadcast|network|peer))';
Expand Down

0 comments on commit a8a8af4

Please sign in to comment.