CFLib.org – Common Function Library Project

IsManipulated()

Last updated July 2, 2002
Download UDF

author

Stephan Scheele                                   Stephan Scheele

Version: 1 | Requires: ColdFusion 5 | 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:

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

Search CFLib.org


Latest Additions

Raymond Compton Raymond Compton added
structBlend
20 day(s) ago

Duncan Duncan added
IsZIPUK
20 day(s) ago

Todd Sharp Todd Sharp added
getTagContentAll
26 day(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Created by Raymond Camden / Design by Justin Johnson