cf_trimvars is a quick solution to trim and 'html escaped' structure variables, such as form and url variables.
*** Requirements: ColdFusion 5, MX and up
*** Usage: <cf_trimvars structure = "Structure containing variables to trim and html escaped- mandatory, default: form and url" exclude = "list of variables not to be trimmed" dontescape = "list of variables not to be html escaped">
*** Examples: 1. Trim and escape all URL and FORM variables. Just put below line in your application.cfm <cf_trimvars structure="form,url">
2. Trim and escape all URL and FORM variables, except form.UploadFile as it contains uploaded file. Put below line in your application.cfm <cf_trimvars structure="form,url" exclude="UploadFile">
3. Trim and escape all URL and FORM variables, except form.UploadFile cause it contains uploaded file, and HTMLText cause it contains HTML tags. Put below line in your application.cfm <cf_trimvars structure="form,url" exclude="UploadFile" dontescape="HTMLText">
4. Trim query result. <!--- query database for information ---> <cfquery name = "GetParks" dataSource = "cfsnippets"> SELECT PARKNAME, REGION, STATE FROM Parks </cfquery> <cf_trimvars structure="GetParks">
*** Examples: For a complete example, please click this link
|