dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Using AntiSamy to protect your CFM pages from XSS hacks

I recently posted about a new open source Java project called AntiSamy—which allows you to protect your websites from XSS hacks. I also promised that I'd soon show you some code examples that show you how you can use AntiSamy within ColdFusion.

I've only tested this code under ColdFusion 8. It should theoretically work on any ColdFusion installation, provided you're using a JDK version that supports the compiled version of the AntiSamy code (which is compiled to Java v1.5.)

Before you can actually use AntiSamy, there are a few quick steps you need to make.

more…


View recently run queries in MSSQL 2005

Pinal Dave posted this great little SQL snippet to view most recent queries executed in SQL Server 2005.

select
    deqs.last_execution_time as [Time], dest.text as [Query]
from
    sys.dm_exec_query_stats as deqs
        cross apply
    sys.dm_exec_sql_text(deqs.sql_handle) as dest
order by
    deqs.last_execution_time desc

This is definitely a useful SQL snippet to see what's just happened when you're in a pinch.