File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const createExcerpt = require('../../hooks/create-excerpt');
11
11
const createNotifications = require ( './hooks/create-notifications' ) ;
12
12
const createMentionNotifications = require ( './hooks/create-mention-notifications' ) ;
13
13
const _ = require ( 'lodash' ) ;
14
+ const xss = require ( '../../hooks/xss' ) ;
14
15
15
16
const userSchema = {
16
17
include : {
@@ -21,10 +22,14 @@ const userSchema = {
21
22
}
22
23
} ;
23
24
25
+ const xssFields = [ 'content' , 'contentExcerpt' ] ;
26
+
24
27
//ToDo: Only let users create comments for contributions they are allowed to
25
28
module . exports = {
26
29
before : {
27
- all : [ ] ,
30
+ all : [
31
+ xss ( { fields : xssFields } )
32
+ ] ,
28
33
find : [ ] ,
29
34
get : [ ] ,
30
35
create : [
@@ -71,7 +76,8 @@ module.exports = {
71
76
72
77
after : {
73
78
all : [
74
- populate ( { schema : userSchema } )
79
+ populate ( { schema : userSchema } ) ,
80
+ xss ( { fields : xssFields } )
75
81
] ,
76
82
find : [
77
83
discard ( 'content' , 'user.coverImg' , 'badgeIds' )
You can’t perform that action at this time.
0 commit comments