CFLib.org – Common Function Library Project

IsManipulated()

Last updated July 02, 2002

author

Stephan Scheele

Version: 1 | Requires: CF5 | Library: SecurityLib

Description:
Checks if the URL (maybe a key) was Manipulated or if the form was copied and changed. The file that was called has to be on the same server as the caller file. It doesn't work with the javascript Command self.location.href = "". Please note that cgi.http_refere can be faked. This is not a perfect test.

Return Values:
Returns a boolean.

Example:

<cfoutput>#IsManipulated()#</cfoutput>

Parameters:

No arguments.

Full UDF Source:

/**
 * Checks if the URL (maybe a key) was manipulated or if the form was copied and changed.
 * 
 * @return Returns a boolean. 
 * @author Stephan Scheele (stephan@stephan-t-scheele.de) 
 * @version 1, July 2, 2002 
 */
function isManipulated(){
    if (CGI.HTTP_REFERER eq "") return true;
    else if (REReplaceNoCase(REReplaceNoCase(CGI.HTTP_REFERER, ".*//", "","all"), "/.*", "","all")  neq CGI.HTTP_HOST) return true;
    else return false;
}

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