From 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Mar 2024 09:58:21 +0000 Subject: Deprecate *_config() functions in core. --- include/attach.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index e5a2900b3..efefc73a4 100644 --- a/include/attach.php +++ b/include/attach.php @@ -11,11 +11,12 @@ * @todo Also an 'append' option to the storage function might be a useful addition. */ -use Zotlabs\Lib\Libsync; -use Zotlabs\Lib\Activity; use Zotlabs\Access\PermissionLimits; use Zotlabs\Daemon\Master; use Zotlabs\Lib\AccessList; +use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Config; +use Zotlabs\Lib\Libsync; require_once('include/permissions.php'); require_once('include/security.php'); @@ -801,7 +802,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { // Check storage limits if($options !== 'update') { - $maxfilesize = get_config('system','maxfilesize'); + $maxfilesize = Config::Get('system','maxfilesize'); if(($maxfilesize) && ($filesize > $maxfilesize)) { logger('quota_exceeded'); -- cgit v1.2.3 From 2e15207d0bdbe147f9d1f21030f4c36b02c3dedf Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 17 Apr 2024 07:45:20 +0000 Subject: fix spacing issues in mod wall_attach and make save_chunk() deal with userfile and file array keys --- include/attach.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/attach.php') 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; -- cgit v1.2.3 From 0428a97e00592e20f5a0b6369bd47bb7e10ab437 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 10 Jun 2024 08:56:59 +0000 Subject: docu --- include/attach.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index 2283da1c6..556fd362c 100644 --- a/include/attach.php +++ b/include/attach.php @@ -2668,8 +2668,8 @@ function attach_move($channel_id, $resource_id, $new_folder_hash, $newname = '', * @param int $channel_id * @param int $resource_id * @param string $new_folder_hash - * @param (optional) string $newname - * @param (optional) boolean $recurse + * @param string (optional) $newname + * @param boolean (optional) $recurse * @return array Associative array with: * * \e boolean \b success * * \e string \b resource_id of the new resource -- cgit v1.2.3 From 9c62514c1b6a4c320dc8dd0b7f235067f235b8c8 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 10 Jun 2024 08:58:32 +0000 Subject: docu --- include/attach.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index 556fd362c..6f474961a 100644 --- a/include/attach.php +++ b/include/attach.php @@ -2467,8 +2467,8 @@ function copy_folder_to_cloudfiles($channel, $observer_hash, $srcpath, $cloudpat * @param int $channel_id * @param int $resource_id * @param string $new_folder_hash - * @param (optional) string $newname - * @param (optional) boolean $recurse + * @param string (optional) $newname + * @param boolean (optional) $recurse * @return array Associative array with: * * \e boolean \b success * * \e string \b resource_id -- cgit v1.2.3 From 06183ba01a9f95f905f3797f684526c4576046dc Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 10 Jun 2024 10:00:25 +0000 Subject: duplicate array key --- include/attach.php | 1 - 1 file changed, 1 deletion(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index 6f474961a..449721793 100644 --- a/include/attach.php +++ b/include/attach.php @@ -113,7 +113,6 @@ function z_mime_content_type($filename) { 'odf' => 'application/vnd.oasis.opendocument.formula', 'odi' => 'application/vnd.oasis.opendocument.image', 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odb' => 'application/vnd.oasis.opendocument.base', 'odb' => 'application/vnd.oasis.opendocument.database', 'ott' => 'application/vnd.oasis.opendocument.text-template', 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', -- cgit v1.2.3