aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Storage/Browser.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index f8377eb70..e447a41e8 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -100,7 +100,7 @@ class Browser extends DAV\Browser\Plugin {
$folder_parent = ((isset($arr[1])) ? prev($arr) : '');
$folder_list = attach_folder_select_list($channel_id);
-
+hz_syslog(print_r($folder_list,true));
$siteroot_disabled = get_config('system', 'cloud_disable_siteroot');
$is_root_folder = (($path === 'cloud/' . $nick) ? true : false);
@@ -294,9 +294,16 @@ class Browser extends DAV\Browser\Plugin {
// create a copy of the list which we can alter for the current resource
$folders = $folder_list;
+
if($data['is_dir']) {
- // can not copy a folder into itself
- unset($folders[$folder_hash]);
+
+ $rm_path = $folders[$folder_hash];
+ // can not copy a folder into itself or own child folders
+ foreach($folders as $k => $v) {
+ if(strpos($v, $rm_path) === 0)
+ unset($folders[$k]);
+ }
+
}
$ft['newfolder'] = ['newfolder_' . $id, t('Select a target location'), $data['folder'], '', $folders];