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']; $endDate = $values['date_range_end'];
$sendAttachment = isset($_FILES) && !empty($_FILES); $sendAttachment = isset($_FILES) && !empty($_FILES);
$attachmentList = $sendAttachment ? $_FILES : null; $attachmentList = $sendAttachment ? $_FILES : [];
$attachmentCommentList = $values['legend'] ?? ''; $attachmentCommentList = $values['legend'] ?? '';
$comment = $values['comment'] ?? ''; $comment = $values['comment'] ?? '';
$notificationCount = $_REQUEST['notification_count'] ?? []; $notificationCount = $_REQUEST['notification_count'] ?? [];

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

Loading…
Cancel
Save