aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-04-17 07:45:20 +0000
committerMario <mario@mariovavti.com>2024-04-17 07:45:20 +0000
commit2e15207d0bdbe147f9d1f21030f4c36b02c3dedf (patch)
tree4bde0c01f0948b05be5cb4eae44fab1a3f41fdf8 /include/attach.php
parent716013633ecb09b1c8fd950275f0cbf272b1fe43 (diff)
downloadvolse-hubzilla-2e15207d0bdbe147f9d1f21030f4c36b02c3dedf.tar.gz
volse-hubzilla-2e15207d0bdbe147f9d1f21030f4c36b02c3dedf.tar.bz2
volse-hubzilla-2e15207d0bdbe147f9d1f21030f4c36b02c3dedf.zip
fix spacing issues in mod wall_attach and make save_chunk() deal with userfile and file array keys
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/attach.php b/include/attach.php
index efefc73a4..2283da1c6 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -2982,11 +2982,17 @@ function save_chunk($channel,$start,$end,$len) {
$result = [];
- $tmp_path = $_FILES['files']['tmp_name'];
+ $file = $_FILES['files'] ?? $_FILES['userfile'] ?? [];
+
+ if (!$file) {
+ return $result;
+ }
+
+ $tmp_path = $file['tmp_name'];
$new_base = 'store/[data]/' . $channel['channel_address'] . '/tmp';
os_mkdir($new_base,STORAGE_DEFAULT_PERMISSIONS,true);
- $new_path = $new_base . '/' . $_FILES['files']['name'];
+ $new_path = $new_base . '/' . $file['name'];
if(file_exists($new_path) && intval($start) === 0) {
$result['partial'] = true;
@@ -3008,8 +3014,8 @@ function save_chunk($channel,$start,$end,$len) {
}
if(($len - 1) == $end) {
unlink($tmp_path);
- $result['name'] = $_FILES['files']['name'];
- $result['type'] = $_FILES['files']['type'];
+ $result['name'] = $file['name'];
+ $result['type'] = $file['type'];
$result['tmp_name'] = $new_path;
$result['error'] = 0;
$result['size'] = $len;