CFLib.org – Common Function Library Project

IsManipulated()

Last updated July 2, 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;
}
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