SiobhanElara
asked on
How do I accept hyphenated variable names when looping and evaluating?
I've been using sys-con.com's code in my Application.cfc file to check for malicious input through FORM and URL variables, but I'm running into issues with hyphenated variable names (specifically Google's reCAPTCHA.) This is the code I use:
And this is the error I'm receiving:
Variable G is undefined.
Which makes sense, because it's looking at g-recaptcha-response. What do I need to do to my code to allow it to accept hyphenated variable names?
Thanks!
<cfloop collection="#form#" item="formelement">
<cfif isSimpleValue(evaluate(formelement)) AND refindnocase(sqlregex, "#evaluate(formelement)#")>
<cflocation url="messages.cfm?message=invalid">
<cfset StructClear(form)>
<cfabort>
</cfif>
</cfloop>
And this is the error I'm receiving:
Variable G is undefined.
Which makes sense, because it's looking at g-recaptcha-response. What do I need to do to my code to allow it to accept hyphenated variable names?
Thanks!
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window