[Pkg-owncloud-commits] [owncloud] 122/134: Verify that a file exists before we share it

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 21:44:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit d4be12ab21d191c6db6fad2fdd6f65853a24eafb
Author: Robin Appelman <icewind at owncloud.com>
Date:   Thu Apr 17 12:32:52 2014 +0200

    Verify that a file exists before we share it
---
 lib/public/share.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/public/share.php b/lib/public/share.php
index 0e60e13..c7e893b 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -475,6 +475,16 @@ class Share {
 			$itemSourceName = $itemSource;
 		}
 
+		// verify that the file exists before we try to share it
+		if ($itemType === 'file' or $itemType === 'folder') {
+			$path = \OC\Files\Filesystem::getPath($itemSource);
+			if (!$path) {
+				$message = 'Sharing ' . $itemSourceName . ' failed, because the file does not exist';
+				\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+								throw new \Exception($message);
+ 			}
+ 		}
+		
 		// Verify share type and sharing conditions are met
 		if ($shareType === self::SHARE_TYPE_USER) {
 			if ($shareWith == $uidOwner) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list