[Pkg-owncloud-commits] [owncloud] 171/258: some small fixed, suggested by scrutinizer
David Prévot
taffit at moszumanska.debian.org
Sat Oct 11 17:22:33 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 92540737861a523593d69a4d90c2aa582d795f7a
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Mon Sep 29 11:23:18 2014 +0200
some small fixed, suggested by scrutinizer
---
apps/files_sharing/lib/share/file.php | 6 ++++--
apps/files_sharing/tests/share.php | 2 --
lib/private/share/helper.php | 4 +---
lib/private/share/hooks.php | 2 +-
lib/private/share/share.php | 3 ++-
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index 1086e21..dacdb93 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -57,7 +57,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
* create unique target
* @param string $filePath
* @param string $shareWith
- * @param string $exclude
+ * @param array $exclude (optional)
* @return string
*/
public function generateTarget($filePath, $shareWith, $exclude = null) {
@@ -83,7 +83,9 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
}
}
- return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $exclude, $view);
+ $excludeList = (is_array($exclude)) ? $exclude : array();
+
+ return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
}
public function formatItems($items, $format, $parameters = null) {
diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/share.php
index 8019950..fe80cfc 100644
--- a/apps/files_sharing/tests/share.php
+++ b/apps/files_sharing/tests/share.php
@@ -72,8 +72,6 @@ class Test_Files_Sharing extends Test_Files_Sharing_Base {
$fileinfo = $this->view->getFileInfo($this->filename);
- $pathinfo = pathinfo($this->filename);
-
$result = \OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing::TEST_FILES_SHARING_API_USER2, 31);
diff --git a/lib/private/share/helper.php b/lib/private/share/helper.php
index 90dd12e..2418535 100644
--- a/lib/private/share/helper.php
+++ b/lib/private/share/helper.php
@@ -36,6 +36,7 @@ class Helper extends \OC\Share\Constants {
* @return string Item target
*/
public static function generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $suggestedTarget = null, $groupParent = null) {
+ // FIXME: $uidOwner and $groupParent seems to be unused
$backend = \OC\Share\Share::getBackend($itemType);
if ($shareType == self::SHARE_TYPE_LINK) {
if (isset($suggestedTarget)) {
@@ -53,9 +54,6 @@ class Helper extends \OC\Share\Constants {
if ($shareType == self::SHARE_TYPE_USER) {
// Share with is a user, so set share type to user and groups
$shareType = self::$shareTypeUserAndGroups;
- $userAndGroups = array_merge(array($shareWith), \OC_Group::getUserGroups($shareWith));
- } else {
- $userAndGroups = false;
}
$exclude = array();
diff --git a/lib/private/share/hooks.php b/lib/private/share/hooks.php
index 2be7dc8..66b197b 100644
--- a/lib/private/share/hooks.php
+++ b/lib/private/share/hooks.php
@@ -65,7 +65,7 @@ class Hooks extends \OC\Share\Constants {
// do we also need a file target
if ($item['item_type'] === 'file' || $item['item_type'] === 'folder') {
- $fileTarget = Helper::generateTarget('file', $row['file_target'], self::SHARE_TYPE_USER, $arguments['uid'],
+ $fileTarget = Helper::generateTarget('file', $item['file_target'], self::SHARE_TYPE_USER, $arguments['uid'],
$item['owner'], null, $item['parent']);
} else {
$fileTarget = null;
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index d6b1a2c..cfdc8aa 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -703,7 +703,7 @@ class Share extends \OC\Share\Constants {
// if there is more then one result we don't have to delete the children
// but update their parent. For group shares the new parent should always be
// the original group share and not the db entry with the unique name
- } else if ((int)$item['share_type'] === \OCP\Share::$shareTypeGroupUserUnique) {
+ } else if ((int)$item['share_type'] === self::$shareTypeGroupUserUnique) {
$newParent = $item['parent'];
} else {
$newParent = $item['id'];
@@ -1610,6 +1610,7 @@ class Share extends \OC\Share\Constants {
$permissions, $parentFolder = null, $token = null, $itemSourceName = null, \DateTime $expirationDate = null) {
$queriesToExecute = array();
+ $suggestedItemTarget = null;
$result = self::checkReshare($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $itemSourceName, $expirationDate);
if(!empty($result)) {
--
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