Skip to content

Commit b64979f

Browse files
authored
Merge pull request #11 from coldbox-modules/development
Merge pull request #10 from coldbox-modules/codex/cbantisamy-optional-autoclean-interceptor Add optional AutoClean interceptor registration
2 parents caba059 + d4946d9 commit b64979f

3 files changed

Lines changed: 19 additions & 14 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
}

box.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"AntiSamy",
33
"author":"Ortus Solutions.com <info@ortussolutions.com>",
4-
"version":"2.2.0",
4+
"version":"2.3.0",
55
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbantisamy/@build.version@/cbantisamy-@build.version@.zip",
66
"slug":"cbantisamy",
77
"type":"modules",
@@ -27,7 +27,7 @@
2727
"cbjavaloader":"^2"
2828
},
2929
"devDependencies":{
30-
"commandbox-boxlang":"*",
30+
"commandbox-boxlang":"*",
3131
"commandbox-cfformat":"*",
3232
"commandbox-docbox":"*"
3333
},

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)