JavaScript: Fix regexes for escaping schemes.

This commit is contained in:
Max Schaefer
2019-10-30 14:15:59 +00:00
parent 5349e0f881
commit a8214ce7ee
2 changed files with 12 additions and 3 deletions

View File

@@ -54,11 +54,11 @@ DataFlow::Node getASimplePredecessor(DataFlow::Node nd) {
* into a form described by regular expression `regex`.
*/
predicate escapingScheme(string metachar, string regex) {
metachar = "&" and regex = "&.*;"
metachar = "&" and regex = "&.+;"
or
metachar = "%" and regex = "%.*"
metachar = "%" and regex = "%.+"
or
metachar = "\\" and regex = "\\\\.*"
metachar = "\\" and regex = "\\\\.+"
}
/**