CFLib.org – Common Function Library Project

FixMacPost()

Last updated February 7, 2003
Download UDF

author

Anthony Cooper                                    Anthony Cooper

Version: 2 | Requires: ColdFusion 5 | Library: StrLib

 
Rated 0 time(s). Average Rating: 0

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:

<CFSET FixMacPost()>

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 Shawn Porter added
DeMoronize
3 hour(s) ago

Chris Carey Chris Carey added
readPropertiesFi...
1 day(s) ago

Randy Johnson Randy Johnson added
lastDayofWeek
3 day(s) ago

Frank Marion Frank Marion added
sitemapPing
7 day(s) ago

Top Rated

James Sleeman                                     QuickSort
Rated 5.0, 3 time(s)

Barney Boisvert indentXml
Rated 5.0, 3 time(s)

Nathan Dintenfass                                 queryColumnsToSt...
Rated 5.0, 3 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 3 time(s)

Created by Raymond Camden / Design by Justin Johnson