diff options
author | Björn Schießle <schiessle@owncloud.com> | 2012-10-02 13:09:34 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2012-10-02 13:10:46 +0200 |
commit | 3e3038cafc727649293d5eaf55ec21d84391ff24 (patch) | |
tree | cc82dd7bfcee1da9b4e54b6c17963440157c36ea /lib/public | |
parent | 3fdebaa5dc4a903e9db64f8bafe11929c5f50304 (diff) | |
download | nextcloud-server-3e3038cafc727649293d5eaf55ec21d84391ff24.tar.gz nextcloud-server-3e3038cafc727649293d5eaf55ec21d84391ff24.zip |
merge all possible conflicts into on array
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index 8b3e5581d7b..61b1a571d84 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -1002,22 +1002,21 @@ class Share { } } // Check if target already exists - $targetConflict = false; - + $checkTarget = array(); if( $itemType == "file" or $itemType == "folder") { $itemList1 = self::getItems("file", $target, $shareType, $shareWith); $itemList2 = self::getItems("folder", $target, $shareType, $shareWith); - if ( !empty($itemList1) or !empty($itemList2)) { - $targetConflict = true; - } - } else { - $itemList = self::getItems($itemType, $target, $shareType, $shareWith); - if ( !empty($itemList) ) { - $targetConflict = true; + if ( !empty($itemList1) ) { + $checkTarget = array_merge($checkTarget, $itemList1); + } + if ( !empty($itemList2) ) { + $checkTarget = array_merge($checkTarget, $itemList2); } + } else { + $checkTarget = self::getItems($itemType, $target, $shareType, $shareWith); } - if ($targetConflict) { + if ( !empty($checkTarget) ) { foreach ($checkTarget as $item) { // Skip item if it is the group parent row if (isset($groupParent) && $item['id'] == $groupParent) { |