diff options
author | Björn Schießle <schiessle@owncloud.com> | 2014-03-11 16:55:52 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2014-03-11 16:55:52 +0100 |
commit | 03f40116e1826771e1ffcc086232020360461c97 (patch) | |
tree | 892f497c8f4f5679a6949ce083076fb4653f3842 /lib | |
parent | c0b567dbeccdaf86fe1533babd88d1950831dd4e (diff) | |
parent | a09df0083e6fa5c465c85d58ea04981538b41c32 (diff) | |
download | nextcloud-server-03f40116e1826771e1ffcc086232020360461c97.tar.gz nextcloud-server-03f40116e1826771e1ffcc086232020360461c97.zip |
Merge pull request #7665 from owncloud/fix_ocs_share_api_paths
Fix ocs share api paths
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/share.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index 2fed41488ca..dd9e1bbf9a9 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -1252,18 +1252,23 @@ class Share { if (isset($row['parent'])) { $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); $parentResult = $query->execute(array($row['parent'])); + //$query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); + //$parentResult = $query->execute(array($row['id'])); if (\OC_DB::isError($result)) { \OC_Log::write('OCP\Share', 'Can\'t select parent: ' . \OC_DB::getErrorMessage($result) . ', select=' . $select . ' where=' . $where, \OC_Log::ERROR); } else { $parentRow = $parentResult->fetchRow(); - $splitPath = explode('/', $row['path']); $tmpPath = '/Shared' . $parentRow['file_target']; + // find the right position where the row path continues from the target path + $pos = strrpos($row['path'], $parentRow['file_target']); + $subPath = substr($row['path'], $pos); + $splitPath = explode('/', $subPath); foreach (array_slice($splitPath, 2) as $pathPart) { $tmpPath = $tmpPath . '/' . $pathPart; } - $row['path'] = $tmpPath; + $row['path'] = $tmpPath; } } else { if (!isset($mounts[$row['storage']])) { |