Agenda: Validate attachment to update in course event - refs BT#19392

pull/4123/head
Angel Fernando Quiroz Campos 4 years ago
parent 02d2541a0e
commit 82b22e9e89
  1. 2
      main/calendar/agenda.php
  2. 4
      main/inc/lib/agenda.lib.php

@ -272,7 +272,7 @@ if ($allowToEdit) {
$endDate = $values['date_range_end'];
$sendAttachment = isset($_FILES) && !empty($_FILES);
$attachmentList = $sendAttachment ? $_FILES : null;
$attachmentList = $sendAttachment ? $_FILES : [];
$attachmentCommentList = $values['legend'] ?? '';
$comment = $values['comment'] ?? '';
$notificationCount = $_REQUEST['notification_count'] ?? [];

@ -1137,6 +1137,10 @@ class Agenda
if (isset($attachmentArray) && !empty($attachmentArray)) {
$counter = 0;
foreach ($attachmentArray as $attachmentItem) {
if (empty($attachmentItems['id'])) {
continue;
}
$this->updateAttachment(
$attachmentItem['id'],
$id,

Loading…
Cancel
Save