CFLib.org – Common Function Library Project

FixMacPost()

Last updated February 7, 2003

author

Anthony Cooper

Version: 2 | Requires: CF5 | 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:

<CFSET FixMacPost()>

Because this UDF operates on the Form scope structure, there is no visible output.

Parameters:

No arguments.

Full UDF Source:

/**
 * 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;

}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson