From 5f403f3e920ea8f6ed5d0441762b3e4f4a9bd38e Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 30 Apr 2014 16:56:09 +0200 Subject: move the mount point up if a share is mounted to a subfolder and the subfolder no longer exists --- apps/files_sharing/lib/share/file.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'apps/files_sharing/lib/share') diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index af71786b104..91595461a61 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -75,16 +75,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $excludeList = array_merge($excludeList, $exclude); } - $pathinfo = pathinfo($target); - $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : ''; - $name = $pathinfo['filename']; - $i = 2; - while ($view->file_exists($target) || in_array($target, $excludeList)) { - $target = '/' . $name . ' ('.$i.')' . $ext; - $i++; - } - - return $target; + return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view); } public function formatItems($items, $format, $parameters = null) { -- cgit v1.2.3