Returntype erroring on one CF server and not another
Hi all. I've been running our application on ColdFusion 2018 locally with hotfix 9 installed, and ColdFusion 11 running on another server. The method below, despite the fact that it actually returns a string rather than the specified "boolean", has been running without error for a couple of months on both of these servers.
<cffunction name="getFirstTwoIpOctets" returntype="boolean">
<cfargument name="ipIn" type="string" />
<cfscript>
firstTwoIpOctets = "";
if (reFind("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", arguments.ipIn)) {
firstTwoIpOctets = listGetAt(arguments.ipIn, 1, ".") & "." & listGetAt(arguments.ipIn, 2, ".");
}
return firstTwoIpOctets;
</cfscript>
</cffunction>Yesterday, we set up a new ColdFusion 2018 server with hotfix 10. On this server, the erroneous return type of boolean now throws an error. Can anyone tell me why an error would be thrown on the new server and not the older ones? Is it related to the extra hotfix on the new server, or possibly due to a ColdFusion administrator setting? Obviously it would be a simple thing to correct the return type on this method, but its presence could signal the potential for many other errors throughout the large site that I support.
