From c073216d8d33afecb0a95bfbc7d8699be6624ca2 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sat, 30 Jun 2012 20:57:31 -0400 Subject: [PATCH] Don't overwrite the item variable when checking if the item is already shared --- lib/public/share.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/public/share.php b/lib/public/share.php index e214fb46dd6..c39e62ad572 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -130,7 +130,6 @@ class Share { // Verify share type and sharing conditions are met switch ($shareType) { case self::SHARE_TYPE_USER: - \OC_Log::write('OCP\Share', 'share type '.$shareType, \OC_Log::ERROR); if ($shareWith == $uidOwner) { \OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because the user '.$shareWith.' is the item owner', \OC_Log::ERROR); return false; @@ -145,7 +144,7 @@ class Share { return false; } } - if ($item = self::getItems($itemType, $item, self::SHARE_TYPE_USER, $shareWith, $uidOwner, self::FORMAT_NONE, 1) && !empty($item)) { + if ($checkShareExists = self::getItems($itemType, $item, self::SHARE_TYPE_USER, $shareWith, $uidOwner, self::FORMAT_NONE, 1) && !empty($checkShareExists)) { \OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because this item is already shared with the user '.$shareWith, \OC_Log::ERROR); return false; } @@ -158,7 +157,7 @@ class Share { \OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because '.$uidOwner.' is not a member of the group '.$shareWith, \OC_Log::ERROR); return false; } - if ($item = self::getItems($itemType, $item, self::SHARE_TYPE_GROUP, $shareWith, $uidOwner, self::FORMAT_NONE, 1) && !empty($item)) { + if ($checkShareExists = self::getItems($itemType, $item, self::SHARE_TYPE_GROUP, $shareWith, $uidOwner, self::FORMAT_NONE, 1) && !empty($checkShareExists)) { \OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because this item is already shared with the group '.$shareWith, \OC_Log::ERROR); return false; }