Skip to content

Commit

Permalink
Attribute contents on the LHS of regexes are not escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Jan 18, 2016
1 parent 06fee84 commit 6b393eb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/tests/keywords/regex-lhs
@@ -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"
}
}

0 comments on commit 6b393eb

Please sign in to comment.