I just set up a short toy learning ColdFusion page on a server. The page makes a call out to a cffunction, which gets the current date, determines the year, and then returns a boolean reflecting whether or not the current year is a leap year. This information is displayed on the main page in plain text.
page.cfm
<html>
<head>
<cfinclude template="./func.cfm" />
</head>
<body>
<cfset yearList = "2000;2001,2002/2003,2004,2005;2006/2007,2008,2009;2010,2011,2012" >
<cfloop index="year" list=#yearList# delimiters=",;/" >
<cfset isLeapYear = #My_IsLeapYear(year)# >
<cfif isLeapYear is True>
<cfoutput>
#year# is a leap year!
</cfoutput>
<cfelse>
<cfoutput>
#year# is not a leap year.
</cfoutput>
</cfif>
<br>
</cfloop>
</body>
</html>
func.cfm
<cffunction name="My_IsLeapYear" output="false" access="public" returnType="boolean">
<cfargument name="year" type="numeric" required="true" default="" />
<cfset var isLeapYear = (DaysInYear(CreateDate(arguments.year,1,1)) EQ 366) />
<cfreturn isLeapYear>
</cffunction>
Trying to access this page caused a horrific memory leak and took down the server where it was hosted. I'm at a loss. Any thoughts?