From 3f6b6dfaf3ea8fbb2845d3f3c40e00a0e6d3ce06 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 27 Jun 2021 15:20:06 +0000 Subject: fix regression in relation with recent photo changes --- 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 db7046ef0..09d4005e8 100644 --- a/include/attach.php +++ b/include/attach.php @@ -668,8 +668,8 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { $def_extension = '.jpg'; if($gis[2] === IMAGETYPE_PNG) $def_extension = '.png'; - if($gis[2] === IMAGETYPE_WEBP) - $def_extension = '.webp'; + if($gis[2] === IMAGETYPE_WEBP) + $def_extension = '.webp'; } // If we know it's a photo, over-ride the type in case the source system could not determine what it was -- cgit v1.2.3 From a2403042c25a9202e8b926962c5035d34c0e08a3 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 17 Aug 2021 07:53:07 +0000 Subject: make sure we have a path before running getimagesize() on it --- include/attach.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index 09d4005e8..56fb936e7 100644 --- a/include/attach.php +++ b/include/attach.php @@ -658,8 +658,12 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { $def_extension = ''; $is_photo = 0; - $gis = @getimagesize($src); - logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA); + + if ($src) { + $gis = @getimagesize($src); + logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA); + } + if(($gis) && ($gis[2] === IMAGETYPE_GIF || $gis[2] === IMAGETYPE_JPEG || $gis[2] === IMAGETYPE_PNG || $gis[2] === IMAGETYPE_WEBP)) { $is_photo = 1; if($gis[2] === IMAGETYPE_GIF) -- cgit v1.2.3 From 5b73cee0d8fc331984305eb8461b37d66e4e8335 Mon Sep 17 00:00:00 2001 From: Zot Date: Mon, 30 Aug 2021 07:56:00 +0000 Subject: file is stored in wrong directory (/) if uploaded using photo module and it... --- include/attach.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index 56fb936e7..ef3d6e242 100644 --- a/include/attach.php +++ b/include/attach.php @@ -684,7 +684,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { $pathname = ''; - if($is_photo) { + if($source === 'photos') { if($newalbum) { $pathname = filepath_macro($newalbum); } @@ -698,6 +698,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { elseif(array_key_exists('folder',$arr)) { $pathname = find_path_by_hash($channel['channel_id'], $arr['folder']); } + if(! $pathname) { $pathname = filepath_macro($upload_path); } -- cgit v1.2.3 From 4ba47698d7d0ef6c799bd0a28045c1d1e49c76f3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 29 Sep 2021 21:47:12 +0200 Subject: revise content import/export part 2 --- 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 ef3d6e242..067da21ae 100644 --- a/include/attach.php +++ b/include/attach.php @@ -2442,7 +2442,6 @@ function attach_export_data($channel, $resource_id, $deleted = false, $zap_compa return $ret; } - /** * @brief Strip off 'store/nickname/' from the provided path * -- cgit v1.2.3 From 2968bf8241d2969c4d51f1651fc3f8c7688b2fca Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Dec 2021 12:17:19 +0000 Subject: merge branch perms_ng into dev --- include/attach.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index 067da21ae..2109b84f1 100644 --- a/include/attach.php +++ b/include/attach.php @@ -15,10 +15,10 @@ use Zotlabs\Lib\Libsync; use Zotlabs\Lib\Activity; use Zotlabs\Access\PermissionLimits; use Zotlabs\Daemon\Master; +use Zotlabs\Lib\AccessList; require_once('include/permissions.php'); require_once('include/security.php'); -require_once('include/group.php'); /** * @brief Guess the mimetype from file ending. @@ -2208,7 +2208,7 @@ function attach_recursive_perms($arr_allow_cid, $arr_allow_gid, $arr_deny_cid, $ //lookup all channels in sharee group and add them to sharee $arr_allow_cid if($arr_allow_gid) { - $in_group = expand_groups($arr_allow_gid); + $in_group = AccessList::expand($arr_allow_gid); $arr_allow_cid = array_unique(array_merge($arr_allow_cid, $in_group)); } @@ -2280,7 +2280,7 @@ function attach_recursive_perms($arr_allow_cid, $arr_allow_gid, $arr_deny_cid, $ //check sharee arr_allow_cid against members of allow_gid of all parent folders foreach($parent_arr['allow_gid'] as $folder_arr_allow_gid) { //get the group members - $folder_arr_allow_cid = expand_groups($folder_arr_allow_gid); + $folder_arr_allow_cid = AccessList::expand($folder_arr_allow_gid); foreach($folder_arr_allow_cid as $ac_hash) { $count_values[$ac_hash]++; } -- cgit v1.2.3