私は会社のコードのやり直しに取り組んでおり、明快で読みやすく、適度に安全な application.cfm を作成したいと考えています。
いいえ、application.cfc は使用していません。ですから、それについては議論しないでください。
セキュリティのために追加するスクリプトを知りたいだけです。
私はcoldfusion 8標準、sql 2008を使用しています。
これは私が現在使用しているスクリプトの 1 つですが、他のコールドフュージョン プログラマーの意見を聞きたいです。
<cfset temp = cleanScopes('form,url') />
<!--- another method to clean url/form data from http://www.garyrgilbert.com/tools/coldfusion/cleanScopes.cfm.txt --->
<cffunction name="cleanScopes" access="public" returntype="void">
<cfargument name="scopesToClean" type="string" required="yes">
<cfargument name="charlist" type="string" required="no" default="">
<cfscript>
reTags ="<[^/>]*>|</.*>";
</cfscript>
<cfloop list="#scopestoClean#" index="scopeName">
<cfif not findnocase("multipart/form-data",cgi.CONTENT_TYPE)>
<cfscript>
s=Evaluate(scopeName);
for(field in s)
if (isSimpleValue(s[field])){
if(reTags neq '')
do { prev=s[field];
s[field]=REReplaceNoCase(s[field],reTags,"","ALL");
} while (prev NEQ s[field]);
structUpdate(s,field,prev);
if (charlist neq '')
s[field] = replacelist(s[field],charlist,'');
}
</cfscript>
</cfif>
</cfloop>
<cfreturn>
</cffunction>
お時間をいただきありがとうございます。