| @@ -52,9 +52,9 @@ | ||
| 52 | 52 | ? 0 |
| 53 | 53 | : (int) Task::whereIn('id', $task_ids) |
| 54 | 54 | ->whereNull('archived_at') |
| 55 | 55 | ->whereNull('parent_id') |
| 56 | - ->excludeTemplateBoards() | |
| 56 | + ->onActiveAvailableBoards() | |
| 57 | 57 | ->count(); |
| 58 | 58 | |
| 59 | 59 | return [ |
| 60 | 60 | 'data' => $tasksArray, |
| @@ -439,13 +439,32 @@ | ||
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - | |
| 443 | + /** | |
| 444 | + * Create a task with field-specific sanitization for its request data. | |
| 445 | + * | |
| 446 | + * @param Request $request | |
| 447 | + * @param int $board_id | |
| 448 | + * @return mixed | |
| 449 | + */ | |
| 444 | 450 | public function create(Request $request, $board_id) |
| 445 | 451 | { |
| 446 | 452 | $board_id = absint($board_id); |
| 447 | - $taskData = $this->taskSanitizeAndValidate($request->getSafe('task'), [ | |
| 453 | + $safeTaskData = $request->getSafe('task'); | |
| 454 | + $rawTaskData = $request->get('task', []); | |
| 455 | + | |
| 456 | + // Milkdown serializes pasted URLs as <https://...>, which generic text | |
| 457 | + // sanitization removes as a tag. | |
| 458 | + if ( | |
| 459 | + is_array($safeTaskData) && | |
| 460 | + is_array($rawTaskData) && | |
| 461 | + array_key_exists('description', $rawTaskData) | |
| 462 | + ) { | |
| 463 | + $safeTaskData['description'] = fluent_boards_sanitize_description($rawTaskData['description']); | |
| 464 | + } | |
| 465 | + | |
| 466 | + $taskData = $this->taskSanitizeAndValidate($safeTaskData, [ | |
| 448 | 467 | 'title' => 'required|string', |
| 449 | 468 | 'board_id' => 'required|numeric', |
| 450 | 469 | 'stage_id' => 'required|numeric', |
| 451 | 470 | 'priority' => 'nullable|string', |
| @@ -735,9 +754,9 @@ | ||
| 735 | 754 | $task_id = absint($task_id); |
| 736 | 755 | //Properties in col: settings, assignees,crm_contact_id, archived_at(AUTO_SET_TIMESTAMP) , status, title, description, priority, is_watching, is_template |
| 737 | 756 | $col = $request->getSafe('property', 'sanitize_text_field'); |
| 738 | 757 | if ($col === 'description') { |
| 739 | - $value = $request->getSafe('value', 'wp_kses_post'); | |
| 758 | + $value = $request->getSafe('value', 'fluent_boards_sanitize_description'); | |
| 740 | 759 | } elseif ($col === 'settings' || $col === 'assignees') { |
| 741 | 760 | $value = $request->get('value'); |
| 742 | 761 | if (is_array($value) && isset($value['cover']) && is_array($value['cover'])) { |
| 743 | 762 | if (isset($value['cover']['backgroundColor'])) { |
| @@ -1475,9 +1494,9 @@ | ||
| 1475 | 1494 | { |
| 1476 | 1495 | $default_config = [ |
| 1477 | 1496 | [ |
| 1478 | 1497 | 'name' => 'due_today', |
| 1479 | - 'label' => __('Today', 'fluent-boards'), | |
| 1498 | + 'label' => __('Due Today', 'fluent-boards'), | |
| 1480 | 1499 | 'visible' => 'true', |
| 1481 | 1500 | 'order' => 1 |
| 1482 | 1501 | ], |
| 1483 | 1502 | [ |
| @@ -1587,9 +1606,9 @@ | ||
| 1587 | 1606 | } |
| 1588 | 1607 | |
| 1589 | 1608 | // Always apply fresh translations based on tab name |
| 1590 | 1609 | $labelMap = [ |
| 1591 | - 'due_today' => __('Today', 'fluent-boards'), | |
| 1610 | + 'due_today' => __('Due Today', 'fluent-boards'), | |
| 1592 | 1611 | 'assigned' => __('Assigned', 'fluent-boards'), |
| 1593 | 1612 | 'upcoming' => __('Upcoming', 'fluent-boards'), |
| 1594 | 1613 | 'overdue' => __('Overdue', 'fluent-boards'), |
| 1595 | 1614 | 'mentioned' => __('Mentioned', 'fluent-boards'), |