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
Shawn Porter added
DeMoronize
3 hour(s) ago
Chris Carey added
readPropertiesFi...
1 day(s) ago
Randy Johnson added
lastDayofWeek
3 day(s) ago
Frank Marion added
sitemapPing
7 day(s) ago
Top Rated
QuickSort
Rated 5.0, 3 time(s)
indentXml
Rated 5.0, 3 time(s)
queryColumnsToSt...
Rated 5.0, 3 time(s)
generateSsccAsn
Rated 5.0, 3 time(s)