Skip to content

Commit

Permalink
#359 - cfloop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Jul 22, 2017
1 parent e83fd0c commit 1e01cea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
15 changes: 1 addition & 14 deletions src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,19 +518,7 @@ private List<CFExpression> unpackTagExpressions(final Element elem) {
if(elem.getAttributes()==null){
return expressions;
}
//Explicitly unpack cfloop
if (elem.getName().equalsIgnoreCase("cfloop")){
List<String> attributes = Arrays.asList("from", "to", "step", "condition", "array", "list");
for (Attribute attr : elem.getAttributes()) {
if (attributes.contains(attr.getName().toLowerCase()) && attr.getValue().trim().length() > 0) {
try {
expressions.add(cfmlParser.parseCFExpression(attr.getValue(), this));
} catch (Exception e) {
System.err.println("Error in parsing : " + attr.getValue() + " on tag " + elem.getName());
}
}
}
}else{ //Unpack any attributes that have a hash expression
//Unpack any attributes that have a hash expression
for (Attribute attr : elem.getAttributes()) {
if (attr.getValue() != null && attr.getValue().contains("#") && !attr.getValue().startsWith("'")
&& !attr.getValue().startsWith("\"")) {
Expand All @@ -556,7 +544,6 @@ private List<CFExpression> unpackTagExpressions(final Element elem) {
}
}
}
}
return expressions;
}

Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/com/cflint/tests/ParseError/cfloop_359.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<cfcomponent>
<cffunction name="foo">
<cfloop list="AdminUser_ID,AdminGroup_ID,AdminPriv" index="key">
</cfloop>
</cffunction>
</cfcomponent>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ {
"totalfiles" : 0
}, {
"totalsize" : 0
} ]

0 comments on commit 1e01cea

Please sign in to comment.