FixMacPost()
Last updated February 7, 2003
Version: 2 | Requires: ColdFusion 5 | Library: StrLib
Description:
Removes extra characters (CR,LF) that are added to form variables when a method="post" is submitted from Internet Explorer on a Mac. This function operates on all variables in the Form scope structure. Thanks to Joshua Miller for his suggestions.
Return Values:
Returns True.
Example:
Because this UDF operates on the Form scope structure, there is no visible output.
Parameters:
No arguments.
Full UDF Source:
<cfscript>
/**
* Remove extra characters from a form post added by Mac IE.
* Changed attributes check to form[ check.
*
* @return Returns True.
* @author Anthony Cooper (ant@bluevan.co.uk)
* @version 2, February 7, 2003
*/
function FixMacPost() {
var thisField = "";
if (findNoCase("mac", cgi.HTTP_USER_AGENT) AND findNoCase("msie", cgi.HTTP_USER_AGENT)) {
for (thisField in form) {
if ((len(form[thisField]) GTE 2) AND NOT findNoCase(getTempDirectory(), form[thisField])) {
form[thisField] = trim(form[thisField]);
}
}
}
return true;
}
</cfscript>
Search CFLib.org
Latest Additions
Raymond Camden added
romanToDecimal
3 day(s) ago
Joe Rinehart added
directoryCopy
4 day(s) ago
Marcos Placona added
arrayGroupsOf
4 day(s) ago
Mosh Teitelbaum added
formatListAsSeri...
25 day(s) ago
Top Rated
UniqueValueList
Rated 5.0, 5 time(s)
QuickSort
Rated 5.0, 3 time(s)
randStr
Rated 5.0, 3 time(s)
FolderSize
Rated 5.0, 3 time(s)