IsManipulated()
Last updated July 2, 2002
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:
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
Tayo Akinmade added
arrayTrim
11 day(s) ago
Will Belden added
longTime
17 day(s) ago
James Sleeman added
quickSort
27 day(s) ago
Ben Forta added
GetHostAddress
30 day(s) ago
Top Rated
EksporSQLData
Rated 5.0, 16 time(s)
backupDatabase
Rated 5.0, 13 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)