Skip to content

Commit ec1a422

Browse files
committed
Add optional AutoClean interceptor registration
1 parent a330a8d commit ec1a422

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

ModuleConfig.cfc

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,16 @@ component {
2323
// Default settings
2424
settings = {
2525
// The library path
26-
libPath : modulePath & "/models/lib",
26+
libPath : modulePath & "/models/lib",
27+
// Automatically register the auto clean interceptor
28+
autoRegisterInterceptor : true,
2729
// Activate auto request capture cleanups
28-
autoClean : true,
30+
autoClean : true,
2931
// Default Policy to use, available are: antisamy, ebay, myspace, slashdot and tinymce
30-
defaultPolicy : "ebay",
32+
defaultPolicy : "ebay",
3133
// Custom Policy absolute path, leave empty if not used
32-
customPolicy : ""
34+
customPolicy : ""
3335
};
34-
35-
// Custom Declared Interceptors
36-
interceptors = [
37-
{
38-
class : "#this.cfmapping#.interceptors.AutoClean",
39-
name : "AutoClean@CBAntiSamy"
40-
}
41-
];
4236
}
4337

4438
/**
@@ -50,6 +44,15 @@ component {
5044
.getWireBox()
5145
.getInstance( "loader@cbjavaloader" )
5246
.appendPaths( settings.libPath );
47+
48+
if ( settings.autoRegisterInterceptor ) {
49+
controller
50+
.getInterceptorService()
51+
.registerInterceptor(
52+
interceptorName = "AutoClean@CBAntiSamy",
53+
interceptorClass = "#this.cfmapping#.interceptors.AutoClean"
54+
);
55+
}
5356
}
5457

5558
}

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ Here are the module settings you can place in your `ColdBox.cfc` under an `antis
8585
// Antisamy settings
8686
moduleSettings = {
8787
"cbantisamy" : {
88+
// Automatically register the auto clean interceptor
89+
autoRegisterInterceptor = true,
8890
// Activate auto request capture cleanups interceptor
8991
autoClean = true,
9092
// Default Policy to use, available are: antisamy, ebay, myspace, slashdot and tinymce

0 commit comments

Comments
 (0)