| 1 |
# |
| 2 |
# PRE: update if regex-escape |
| 3 |
# |
| 4 |
|
| 5 |
# |
| 6 |
# Strings which are expanded in a regex have regex special |
| 7 |
# characters escaped. Because the input strings are unsafe. |
| 8 |
# |
| 9 |
update request { |
| 10 |
Tmp-String-0 := "example.com" |
| 11 |
Tmp-String-1 := "^foo$bar" |
| 12 |
} |
| 13 |
|
| 14 |
if (&Tmp-String-0 !~ /example\.com$/) { |
| 15 |
update reply { |
| 16 |
Filter-Id := "fail 1" |
| 17 |
} |
| 18 |
} |
| 19 |
elsif (&Tmp-String-1 !~ /\^foo\$bar/) { |
| 20 |
update reply { |
| 21 |
Filter-Id := "fail 1" |
| 22 |
} |
| 23 |
} else { |
| 24 |
update reply { |
| 25 |
Filter-Id := "filter" |
| 26 |
} |
| 27 |
} |