Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attribute contents on the LHS of regexes are not escaped
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# PRE: update if regex-escape | ||
# | ||
|
||
# | ||
# Strings which are expanded in a regex have regex special | ||
# characters escaped. Because the input strings are unsafe. | ||
# | ||
update request { | ||
Tmp-String-0 := "example.com" | ||
Tmp-String-1 := "^foo$bar" | ||
} | ||
|
||
if (&Tmp-String-0 !~ /example\.com$/) { | ||
update reply { | ||
Filter-Id := "fail 1" | ||
} | ||
} | ||
elsif (&Tmp-String-1 !~ /\^foo\$bar/) { | ||
update reply { | ||
Filter-Id := "fail 1" | ||
} | ||
} else { | ||
update reply { | ||
Filter-Id := "filter" | ||
} | ||
} |