aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/share/file.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/share/file.php')
-rw-r--r--apps/files_sharing/lib/share/file.php11
1 files changed, 1 insertions, 10 deletions
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) {