Last active
December 7, 2022 16:58
-
-
Save JamoCA/5ebc08505eeb3edfbd54ebdaadc11b8f to your computer and use it in GitHub Desktop.
Test to see if the read-only ColdFusion CGI scope can be cleared be reference.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- 20220204 | |
This is a test to see if the CGI scope can be cleared. | |
(I thought that the CGI scope was "read-only".) | |
Adobe ColdFusion allows it to be cleared by reference. | |
Lucee throws a "can't clear struct, struct is readonly" error. | |
GIST: https://gist.github.com/JamoCA/5ebc08505eeb3edfbd54ebdaadc11b8f | |
CFBUG: https://tracker.adobe.com/#/view/CF-4212734 | |
THREAD: https://community.adobe.com/t5/coldfusion-discussions/cgi-scope-is-empty-with-coldfusion-2021-on-windows-2019/td-p/12634405 | |
TRYCF: Unable to test on TryCF.com or CFFiddle as CGI scope is disabled. | |
BUGTRACKER: https://tracker.adobe.com/#/view/CF-4212734 | |
NOTE: If you test this, you will need to restart the ColdFusion service or the CGI struct will continue to be | |
non-existent when dumped as a whole, but all vars still exist and return the correct. | |
---> | |
<cfdump var="#cgi#" expand="false" label="CGI (pre-clear)"> | |
<cfscript> | |
function doStuff(struct sourceStruct){ | |
local.s = arguments.sourceStruct; | |
structClear(local.s); | |
} | |
</cfscript> | |
<cfset doStuff(cgi)> | |
<cfdump var="#cgi#" label="CGI (post-clear)"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment