I'm using antiSami
with my ColdFusion project. I'm loading antiSami through onApplicationStart() like this:
local.jarsArray =
[
expandPath("lib/antisami/antisamy-1.4.4.jar")
];
application.antiSamiPolicyPath = expandPath("lib/antisami/antisamy-slashdot-1.4.4.xml");
application.javaLoader = createObject("lib.javaloader.JavaLoader").init(local.jarsArray);
application.antiSami = application.javaLoader.create("org.owasp.validator.html.AntiSamy").init();
I can see the antiSami object if I dump application.antiSami
. However, once I add the following line:
local.result = application.antiSami.scan("some text", application.antiSamiPolicyPath);
I get this generic browser 500 message:
Server Error, HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
Under the hood, I found this error through CFBuilder:
"Error","web-4","06/14/11","15:27:04","80BBF6B60584F6D148A7DC2A12007C03","org/apache/batik/css/parser/ParseException The specific sequence of files included or processed is: C:\ColdFusion9\wwwroot\gamers\index.cfm, line: 25 "
Any ideas what this error is all about?
It turns out using AntiSamy requires a certain number of dependencies: batik-css.jar
, batik-util.jar
, nekohtml.jar
, and xerceslmpl.jar
. Once those are loaded, antiSamy should work fine, and it does.