CFLib.org – Common Function Library Project

FixMacPost()

Last updated February 07, 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;

}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson