diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-20 12:02:04 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-06-20 12:02:04 +0200 |
commit | 0129437cd50a5099d27efe4a16cc9e93fc36b4f6 (patch) | |
tree | 5e62b28d860216486de3a48c6170c15e220134fc | |
parent | a3111e8589346739cfa83607f6001341c76f5139 (diff) | |
download | nextcloud-server-0129437cd50a5099d27efe4a16cc9e93fc36b4f6.tar.gz nextcloud-server-0129437cd50a5099d27efe4a16cc9e93fc36b4f6.zip |
Make getShareFolder use given view instead of static FS (#25150)
-rw-r--r-- | apps/files_sharing/lib/helper.php | 12 | ||||
-rw-r--r-- | 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 ee6af9939ed..612df1b207a 100644 --- a/apps/files_sharing/lib/helper.php +++ b/apps/files_sharing/lib/helper.php @@ -302,19 +302,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 1e554cc5948..3a65794b606 100644 --- a/apps/files_sharing/lib/sharedmount.php +++ b/apps/files_sharing/lib/sharedmount.php @@ -75,7 +75,7 @@ class SharedMount extends MountPoint implements MoveableMount { $parent = dirname($share['file_target']); if (!$this->recipientView->is_dir($parent)) { - $parent = Helper::getShareFolder(); + $parent = Helper::getShareFolder($this->recipientView); } $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget( |