[Pkg-owncloud-commits] [owncloud] 78/90: for password protected link shares the password is stored in shareWith, so we need to set this manually to null for the hooks

David Prévot taffit at moszumanska.debian.org
Fri Feb 6 21:10:58 UTC 2015


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

taffit pushed a commit to branch master
in repository owncloud.

commit c58501ee870ed9ad5792242dee0706876a5ef346
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Thu Feb 5 17:11:27 2015 +0100

    for password protected link shares the password is stored in shareWith, so we need to set this manually to null for the hooks
---
 lib/private/share/share.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index be11356..00c7bed 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -1102,13 +1102,20 @@ class Share extends \OC\Share\Constants {
 	 * @return null
 	 */
 	protected static function unshareItem(array $item, $newParent = null) {
+
+		$shareType = (int)$item['share_type'];
+		$shareWith = null;
+		if ($shareType !== \OCP\Share::SHARE_TYPE_LINK) {
+			$shareWith = $item['share_with'];
+		}
+
 		// Pass all the vars we have for now, they may be useful
 		$hookParams = array(
 			'id'            => $item['id'],
 			'itemType'      => $item['item_type'],
 			'itemSource'    => $item['item_source'],
-			'shareType'     => (int)$item['share_type'],
-			'shareWith'     => $item['share_with'],
+			'shareType'     => $shareType,
+			'shareWith'     => $shareWith,
 			'itemParent'    => $item['parent'],
 			'uidOwner'      => $item['uid_owner'],
 		);

-- 
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