diff options
Diffstat (limited to 'apps/files_sharing/lib/share/file.php')
-rw-r--r-- | apps/files_sharing/lib/share/file.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index 6c676f47a0c..67ef3937e6d 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -40,15 +40,16 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { private $path; public function isValidSource($itemSource, $uidOwner) { - $path = \OC\Files\Filesystem::getPath($itemSource); - if ($path) { + try { + $path = \OC\Files\Filesystem::getPath($itemSource); // FIXME: attributes should not be set here, // keeping this pattern for now to avoid unexpected // regressions $this->path = \OC\Files\Filesystem::normalizePath(basename($path)); return true; + } catch (\OCP\Files\NotFoundException $e) { + return false; } - return false; } public function getFilePath($itemSource, $uidOwner) { @@ -57,12 +58,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $this->path = null; return $path; } else { - $path = \OC\Files\Filesystem::getPath($itemSource); - if ($path) { + try { + $path = \OC\Files\Filesystem::getPath($itemSource); return $path; + } catch (\OCP\Files\NotFoundException $e) { + return false; } } - return false; } /** |