aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/share.php')
-rw-r--r--lib/public/share.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index fe996dbe266..9ab956d84b9 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -140,8 +140,13 @@ class Share {
$source = -1;
$cache = false;
- $view = new \OC\Files\View('/' . $user . '/files/');
- $meta = $view->getFileInfo(\OC\Files\Filesystem::normalizePath($path));
+ $view = new \OC\Files\View('/' . $user . '/files');
+ if ($view->file_exists($path)) {
+ $meta = $view->getFileInfo($path);
+ } else {
+ // if the file doesn't exists yet we start with the parent folder
+ $meta = $view->getFileInfo(dirname($path));
+ }
if($meta !== false) {
$source = $meta['fileid'];