Skip to content

Commit

Permalink
Fixed compat with the notification center for temporary uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Dec 1, 2021
1 parent 0aefc53 commit df6fcf4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MPFormsFormManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,18 @@ public function storeData(array $submitted, array $labels, array $files)
// If the user marked the form field to upload the file into
// a certain directory, this check will return false and thus
// we won't move anything.

if (is_uploaded_file($file['tmp_name'])) {
$target = sprintf('%s/system/tmp/mp_forms_%s.%s',
TL_ROOT,
$target = sprintf('%s/mp_forms_%s.%s',
sys_get_temp_dir(),
basename($file['tmp_name']),
$this->guessFileExtension($file)
);
move_uploaded_file($file['tmp_name'], $target);
$files[$k]['tmp_name'] = $target;

// Compatibility with notification center
$files[$k]['uploaded'] = true;
}
}

Expand Down

0 comments on commit df6fcf4

Please # to comment.