From a636078e6cfa12429ec780937c25e5034c185c0f Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 17 Jun 2016 11:11:59 +0200 Subject: [PATCH] Make getShareFolder use given view instead of static FS --- apps/files_sharing/lib/Helper.php | 12 ++++++++---- apps/files_sharing/lib/SharedMount.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index e4640f82eb6..2353a281b7e 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -277,19 +277,23 @@ class Helper { /** * get default share folder * + * @param \OC\Files\View * @return string */ - public static function getShareFolder() { + public static function getShareFolder($view = null) { + if ($view === null) { + $view = Filesystem::getView(); + } $shareFolder = \OC::$server->getConfig()->getSystemValue('share_folder', '/'); $shareFolder = Filesystem::normalizePath($shareFolder); - if (!Filesystem::file_exists($shareFolder)) { + if (!$view->file_exists($shareFolder)) { $dir = ''; $subdirs = explode('/', $shareFolder); foreach ($subdirs as $subdir) { $dir = $dir . '/' . $subdir; - if (!Filesystem::is_dir($dir)) { - Filesystem::mkdir($dir); + if (!$view->is_dir($dir)) { + $view->mkdir($dir); } } } diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index 83527053f43..2b066bd2d94 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -81,7 +81,7 @@ class SharedMount extends MountPoint implements MoveableMount { $parent = dirname($share->getTarget()); if (!$this->recipientView->is_dir($parent)) { - $parent = Helper::getShareFolder(); + $parent = Helper::getShareFolder($this->recipientView); } $newMountPoint = $this->generateUniqueTarget( -- 2.39.5