PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.2.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.2.0
2.2.0 2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 All 43 releases
← All changes | app/Http/Controllers/CommentController.php +8 -13 2.0.15 → 2.2.0 View file →
@@ -52,9 +52,9 @@
52 52 $requestData = [
53 53 'parent_id' => $request->getSafe('parent_id', function ($value) {
54 54 return (empty($value)) ? null : intval( $value);
55 55 }, null),
56 - 'description' => $request->getSafe('comment', 'sanitize_textarea_field'),
56 + 'description' => $this->commentService->sanitizeContent($request->get('comment', '')),
57 57 'created_by' => get_current_user_id(),
58 58 'task_id' => (int) $task_id,
59 59 'type' => $request->getSafe('comment_type', 'sanitize_text_field', 'comment'),
60 60 'board_id' => (int) $board_id,
@@ -83,19 +83,10 @@
83 83 $rawDescription = $commentData['description'];
84 84 $mentionData = $this->getMentionData($request, $board_id);
85 85 $commentData['settings'] = [ 'raw_description' => $rawDescription, 'mentioned_id' => $mentionData ];
86 86
87 - // Ensure UTF-8 encoding for comment description
88 - $description = mb_convert_encoding($commentData['description'], 'UTF-8', 'auto');
87 + $commentData['description'] = $this->commentService->renderContent($rawDescription, $mentionData);
89 88
90 - if(!empty($mentionData)) {
91 - // Process mentions and links with UTF-8 support
92 - $commentData['description'] = $this->commentService->processMentionAndLink($description, $mentionData);
93 - } else {
94 - // Process links with UTF-8 support
95 - $commentData['description'] = $this->commentService->checkIfCommentHaveLinks($description);
96 - }
97 -
98 89 $comment = $this->commentService->create($commentData, $task_id, $board_id);
99 90 if (!empty($imageIds)) {
100 91 $this->commentService->attachCommentImages($comment, $imageIds);
101 92 $comment->load(['images']);
@@ -138,9 +129,9 @@
138 129
139 130 public function update(Request $request, $board_id, $comment_id)
140 131 {
141 132 $requestData = [
142 - 'description' => $request->getSafe('comment', 'sanitize_textarea_field')
133 + 'description' => $this->commentService->sanitizeContent($request->get('comment', ''))
143 134 ];
144 135
145 136 $validationRules = [
146 137 'description' => 'required|string'
@@ -209,9 +200,9 @@
209 200
210 201 public function updateReply(Request $request, $board_id, $reply_id)
211 202 {
212 203 $requestData = [
213 - 'description' => $request->getSafe('comment', 'sanitize_textarea_field')
204 + 'description' => $this->commentService->sanitizeContent($request->get('comment', ''))
214 205 ];
215 206
216 207 $validationRules = [
217 208 'description' => 'required|string'
@@ -252,8 +243,12 @@
252 243 }
253 244
254 245 public function sendMailAfterComment($commentId, $recipientUserIds)
255 246 {
247 + if (empty($recipientUserIds)) {
248 + return;
249 + }
250 +
256 251 $current_user_id = get_current_user_id();
257 252
258 253 /* this will run in background as soon as possible */
259 254 /* sending Model or Model Instance won't work here */