mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
JS: isAngularTemplateAttributeName
This commit is contained in:
@@ -93,7 +93,7 @@ public class HTMLExtractor implements IExtractor {
|
||||
|
||||
String source = attr.getValue();
|
||||
RowColumnVector valueStart = attr.getValueSegment().getRowColumnVector();
|
||||
if (JS_ATTRIBUTE.matcher(attr.getName()).matches()) {
|
||||
if (JS_ATTRIBUTE.matcher(attr.getName()).matches() || isAngularTemplateAttributeName(attr.getName())) {
|
||||
snippetLoC =
|
||||
extractSnippet(
|
||||
2,
|
||||
@@ -128,6 +128,12 @@ public class HTMLExtractor implements IExtractor {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAngularTemplateAttributeName(String name) {
|
||||
return name.startsWith("[") && name.endsWith("]") ||
|
||||
name.startsWith("(") && name.endsWith(")") ||
|
||||
name.startsWith("*ng");
|
||||
}
|
||||
|
||||
/** List of HTML attributes whose value is interpreted as JavaScript. */
|
||||
private static final Pattern JS_ATTRIBUTE =
|
||||
Pattern.compile(
|
||||
|
||||
Reference in New Issue
Block a user