Permalink
Browse files

account for empty spaces in the property in the propertyHasValue() me…

…thod
  • Loading branch information...
1 parent 49b3bdd commit 3209e8dbfa6218fc6bf1a98473f906a08a122cd8 @tony-garcia committed Apr 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 ValidateThis/core/Validation.cfc
View
2 ValidateThis/core/Validation.cfc
@@ -92,7 +92,7 @@
<cffunction name="propertyHasValue" returntype="boolean" access="public" output="false" hint="I determine whether the property that the validation references has a value.">
<cfargument name="propertyName" type="any" required="false" default="#getPropertyName()#" />
<cfset var theVal = getObjectValue(arguments.propertyName) />
- <cfreturn (isSimpleValue(theVal) and len(theVal) gt 0) or (isStruct(theVal) and structCount(theVal) gt 0) or (isArray(theVal) and arrayLen(theVal) gt 0)/>
+ <cfreturn (isSimpleValue(theVal) and len(trim(theVal)) gt 0) or (isStruct(theVal) and structCount(theVal) gt 0) or (isArray(theVal) and arrayLen(theVal) gt 0)/>
</cffunction>
<cffunction name="propertyExists" returntype="boolean" access="public" output="false" hint="I report whether a property exists in the object being validated.">

0 comments on commit 3209e8d

Please sign in to comment.