teamcfadvance / ValidateThis

An object oriented validation framework for ColdFusion objects
http://www.validatethis.org
44 stars 32 forks source link

Prefix serialized JSON and MinPatternsMatch #68

Open orangexception opened 12 years ago

orangexception commented 12 years ago

If the CFIDE option to Prefix serialized JSON is set to "//", then the JavaScript validation code throws "Uncaught SyntaxError: Unexpected end of input." The code looks like this...

.rules('add',{"minpatternsmatch"://{"letters":

Just a FYI, I've disabled the CFIDE setting for the moment.

aliaspooryorik commented 12 years ago

I've been looking into this and basically there is no way around it. There is an open ticket for this as a ER on the Adobe bugtracker: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80423

From what I can determine there is no way to tell ColdFusion to ignore the securePrefix, or to get the securePrefix (as it may not be "//") so that it can be stripped.

Any ideas welcomed!

orangexception commented 12 years ago

Ah, I gotcha. It doesn't look like it's worth the trouble.

In theory, you can snag the securePrefix using the admin API, but you'd need to know the CFIDE admin username and password (which I probably won't give you). http://www.cfexecute.com/admin-api-documentation/runtime-cfc/#method_getRuntimeProperty

aliaspooryorik commented 12 years ago

Thanks for the feedback, the only way I can see of doing this is to replace the native JSON serialisation with cfJSON or similar. For now I think this might have to go on the "nice to have" list.