Created
March 11, 2026 17:51
-
-
Save trycf/d3b33a164f28aad3d355120915f10824 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains hidden or 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
| <cfscript> | |
| rc = { | |
| "key0": "hello%252520world87%%20test", | |
| "key1": "hello%252520world", | |
| "key2": "hello%2520world 87%25" | |
| } | |
| rc.each( ( key, value ) => { | |
| if ( !isNull( value ) && isSimpleValue( value ) ) { | |
| rc[key] = rc[key].toString().reReplace( "%(?![0-9A-Fa-f]{2})", "%2525", "all" ); | |
| if ( rc[key].reFind( "%[0-9A-Fa-f]{2}" ) ) rc[key] = urlDecode( rc[key] ); | |
| rc[key] = rc[key].toString().reReplace( "%(?![0-9A-Fa-f]{2})", "%2525", "all" ); | |
| if ( rc[key].reFind( "%[0-9A-Fa-f]{2}" ) ) rc[key] = urlDecode( rc[key] ); | |
| } | |
| } ); | |
| dump( rc ); | |
| </cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment