diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-06 14:15:37 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-06 14:15:37 -0400 |
commit | e954de60309cca9f8e56aa666b31dd3314ff6fff (patch) | |
tree | a8d1bee022bee71828127695508b131bd1dcd5d0 /lib | |
parent | e280e3ecc9e96a996751f5ae8f5303461f928c58 (diff) | |
download | nextcloud-server-e954de60309cca9f8e56aa666b31dd3314ff6fff.tar.gz nextcloud-server-e954de60309cca9f8e56aa666b31dd3314ff6fff.zip |
Make the file source path relative earlier
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/share.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index b819924dae7..c31f316efef 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -235,7 +235,7 @@ class Share { * @return Returns true on success or false on failure */ public static function unshare($itemType, $itemSource, $shareType, $shareWith) { - if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(), self::FORMAT_NONE, null, 1, false)) { + if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(), self::FORMAT_NONE, null, 1)) { self::delete($item['id']); return true; } @@ -524,6 +524,10 @@ class Share { $result = $query->execute(); $items = array(); while ($row = $result->fetchRow()) { + // Remove root from file source paths + if (isset($uidOwner) && isset($row['file_source'])) { + $row['file_source'] = substr($row['file_source'], $root); + } // Return only the item instead of a 2-dimensional array if ($limit == 1 && $row['item_type'] == $itemType && $row[$column] == $item) { if ($format == self::FORMAT_NONE) { @@ -538,10 +542,6 @@ class Share { // Remove the parent group share unset($items[$row['parent']]); } - // Remove root from file source paths - if (isset($uidOwner) && isset($row['file_source'])) { - $row['file_source'] = substr($row['file_source'], $root); - } // TODO Check this outside of the loop // Check if this is a collection of the requested item type if ($row['item_type'] != $itemType) { |