From e54ba7ecbc7391069b38d9f911bf77623d0ee582 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 20 Feb 2017 23:03:48 -0800 Subject: fix find_folder_hash_by_path() which was not safe against multiple attach structures with the same filename but in different directories --- Zotlabs/Storage/Browser.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index a30eedba5..f527a6a44 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -314,7 +314,13 @@ class Browser extends DAV\Browser\Plugin { $quota['desc'] = $quotaDesc; $quota['warning'] = ((($limit) && ((round($used / $limit, 1) * 100) >= 90)) ? t('WARNING:') : ''); // 10485760 bytes = 100MB - $path = trim(str_replace('cloud/' . $this->auth->owner_nick, '', $path), '/'); + // strip 'cloud/nickname', but only at the beginning of the path + + $special = 'cloud/' . $this->auth->owner_nick; + $count = strlen($special); + + if(strpos($path,$special) === 0) + $path = trim(substr($path,$count),'/'); $output .= replace_macros(get_markup_template('cloud_actionspanel.tpl'), array( '$folder_header' => t('Create new folder'), -- cgit v1.2.3