CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

Rule Suggestion: hash in cfloop array

Open bardware opened this issue 5 years ago • 2 comments

<cfloop query=""> in older versions of ACF did not allow # in the query attribute. <cfloop array="..."> requires # in the array attribute as it expects a name of a variable. Otherwise an exception is thrown: Object of type class java.lang.String cannot be used as an array . Maybe someone can build a checker for that.

Thank you!

bardware avatar Apr 29 '19 14:04 bardware

    <cfoutput>#item#</cfoutput>
</cfloop>
<hr>
<cfloop query="y" >
    <cfoutput>a#item1#</cfoutput>

</cfloop>
<hr>
<cfloop query="#y#" >
    <cfoutput>a#item1#</cfoutput>

</cfloop>

ryaneberly avatar Sep 10 '19 22:09 ryaneberly

In my issue I simply wrote Maybe someone can build a checker for that. Maybe it didn't sound as friendly as it was intended. Thanks for caring.

bardware avatar Sep 11 '19 11:09 bardware