diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-19 23:53:43 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-20 00:51:00 +0200 |
commit | e243cb8b7d30374e3de5bbd2d9286c76470b70e6 (patch) | |
tree | 1e02edf245cbb0ee5a756c5421a24b17eae18742 /apps/files_sharing/lib | |
parent | a8f46af20f4fccac0257eba950e70d0da96c4a5a (diff) | |
download | nextcloud-server-e243cb8b7d30374e3de5bbd2d9286c76470b70e6.tar.gz nextcloud-server-e243cb8b7d30374e3de5bbd2d9286c76470b70e6.zip |
chore: Remove deprecated `Share_Helper::generateTarget` `$exclude` parameterchore/add-deprecation-date
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Helper.php | 5 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/File.php | 12 |
2 files changed, 4 insertions, 13 deletions
diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index 3f1937396a0..8efcb7cae7b 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -22,17 +22,16 @@ class Helper { * check if file name already exists and generate unique target * * @param string $path - * @param array $excludeList * @param View $view * @return string $path */ - public static function generateUniqueTarget($path, $excludeList, $view) { + public static function generateUniqueTarget($path, $view) { $pathinfo = pathinfo($path); $ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : ''; $name = $pathinfo['filename']; $dir = $pathinfo['dirname']; $i = 2; - while ($view->file_exists($path) || in_array($path, $excludeList)) { + while ($view->file_exists($path)) { $path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext); $i++; } diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php index 93f98c9e18a..4d93232b638 100644 --- a/apps/files_sharing/lib/ShareBackend/File.php +++ b/apps/files_sharing/lib/ShareBackend/File.php @@ -65,18 +65,12 @@ class File implements \OCP\Share_Backend_File_Dependent { * * @param string $itemSource * @param string $shareWith - * @param array $exclude (optional) * @return string */ - public function generateTarget($itemSource, $shareWith, $exclude = null) { + public function generateTarget($itemSource, $shareWith) { $shareFolder = \OCA\Files_Sharing\Helper::getShareFolder(); $target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($itemSource)); - // for group shares we return the target right away - if ($shareWith === false) { - return $target; - } - \OC\Files\Filesystem::initMountPoints($shareWith); $view = new \OC\Files\View('/' . $shareWith . '/files'); @@ -91,9 +85,7 @@ class File implements \OCP\Share_Backend_File_Dependent { } } - $excludeList = is_array($exclude) ? $exclude : []; - - return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view); + return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $view); } public function formatItems($items, $format, $parameters = null) { |