File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 19
19
}
20
20
21
21
$ agenda = new Agenda ($ type );
22
+ // get filtered type
23
+ $ type = $ agenda ->getType ();
22
24
23
25
switch ($ action ) {
24
26
case 'add_event ' :
25
27
if (!$ agenda ->getIsAllowedToEdit ()) {
26
28
break ;
27
29
}
28
30
$ add_as_announcement = isset ($ _REQUEST ['add_as_annonuncement ' ]) ? $ _REQUEST ['add_as_annonuncement ' ] : null ;
29
- $ comment = isset ($ _REQUEST ['comment ' ]) ? $ _REQUEST ['comment ' ] : null ;
31
+ $ title = isset ($ _REQUEST ['title ' ]) ? Security::remove_XSS ($ _REQUEST ['title ' ]) : null ;
32
+ $ content = isset ($ _REQUEST ['content ' ]) ? Security::remove_XSS ($ _REQUEST ['content ' ]) : null ;
33
+ $ comment = isset ($ _REQUEST ['comment ' ]) ? Security::remove_XSS ($ _REQUEST ['comment ' ]) : null ;
30
34
$ userToSend = isset ($ _REQUEST ['users_to_send ' ]) ? $ _REQUEST ['users_to_send ' ] : [];
31
35
32
36
echo $ agenda ->addEvent (
33
37
$ _REQUEST ['start ' ],
34
38
$ _REQUEST ['end ' ],
35
39
$ _REQUEST ['all_day ' ],
36
- $ _REQUEST [ ' title ' ] ,
37
- $ _REQUEST [ ' content ' ] ,
40
+ $ title ,
41
+ $ content ,
38
42
$ userToSend ,
39
43
$ add_as_announcement ,
40
44
null , //$parentEventId = null,
54
58
$ _REQUEST ['start ' ],
55
59
$ _REQUEST ['end ' ],
56
60
$ _REQUEST ['all_day ' ],
57
- $ _REQUEST [ ' title ' ] ,
58
- $ _REQUEST [ ' content ' ]
61
+ $ title ,
62
+ $ content
59
63
);
60
64
break ;
61
65
case 'delete_event ' :
Original file line number Diff line number Diff line change @@ -160,6 +160,18 @@ public function setType($type)
160
160
}
161
161
}
162
162
163
+ /**
164
+ * Returns the type previously set (and filtered) through setType
165
+ * If setType() was not called, then type defaults to "personal" as
166
+ * set in the class definition.
167
+ */
168
+ public function getType ()
169
+ {
170
+ if (isset ($ this ->type )) {
171
+ return $ this ->type ;
172
+ }
173
+ }
174
+
163
175
/**
164
176
* @param int $id
165
177
*/
You can’t perform that action at this time.
0 commit comments