Copy link to clipboard
Copied
I was just doing some testing on our coldfusion 8 server and it seems like the URL and FORM structures are universaly availible
everywhere, inside a CF function they are passed by reference.
Is there a way to disable this functionality? I have a cffunction that i don't want to have access to URL and FORM
from the main template, for reasons i don't really want to go into.
Copy link to clipboard
Copied
Step 1 - declare all your local variables with the keyword var after your cfargument tags.
Step 2 - inside your function, refer only to the arguments and variables scopes.
Copy link to clipboard
Copied
I've done that where i can. This is more or less a quick hack to fix something while i redesign it to support
a new feature correctly. Due to the situation theres some code that is sensitive to URL params being availible inside
the function.
I never knew until now that URL and FORM where pretty much global. I was trying to find out
if i could create a function that ran in a completely private space with no access to the URL and FORM.