CFFUNCTION and CFARGUMENT don't support new types in ColdFusion 7

by Pete Freitag

One thing I just realized today - that is a bummer, is that the new types supported by cfparam, and IsValid (eg integer, email, zipcode) in ColdFusion 7 are not supported by the returntype attribute in CFFUNCTION, and not supported in the type attribute of CFARGUMENT. Whats up with that?

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.

Comments

Mike Nimer

We thought about this, but realized there was one problem with it. WebServices. The cfargument types need to be converted to wsdl types when you ask CF to convert the CFC to a webservice. And wsdl doesn't have an email type or a regex type (with your custom pattern), for example. This is one reason for isValid(), so you can still run validation inside your cfc methods as needed.

Pete Freitag

Thanks Mike, that makes sense. Though, some of the types such as integer are WSDL types, and would be useful to be able to specify.

Mike Nimer

your right. I'll submit an enhancement list to see if we can't add a few of them.

Ray Horn

This is a non-problem when coding using <cfscript> functions such as inside components because ColdFusion doesn't care what the types of variables are when processing <cfscript> return types or the like. I can post samples to demonstrate this if necessary...