summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2014-05-01 14:58:29 -0400
committerBjörn Schießle <schiessle@owncloud.com>2014-05-01 14:58:29 -0400
commitbf681713c85ae74e004b0684372940a7d86d64f1 (patch)
treecdd6bb00676a54b2bb0c94df2ffcb432d3f8c462 /apps/files_sharing
parent17f5a18922276e908f26b68c24999f7595cf37bc (diff)
parent33883a46f5e91e351e7a3b41a0c80657275af5fb (diff)
downloadnextcloud-server-bf681713c85ae74e004b0684372940a7d86d64f1.tar.gz
nextcloud-server-bf681713c85ae74e004b0684372940a7d86d64f1.zip
Merge pull request #8415 from owncloud/sharing_fix_rename
[sharing] return the new name if a mount point was renamed
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/cache.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 6e5bc04c82f..1f316301c47 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -85,7 +85,8 @@ class Shared_Cache extends Cache {
*/
public function get($file) {
if (is_string($file)) {
- if ($cache = $this->getSourceCache($file)) {
+ $cache = $this->getSourceCache($file);
+ if ($cache) {
$data = $cache->get($this->files[$file]);
$data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom());
$data['path'] = $file;
@@ -96,16 +97,17 @@ class Shared_Cache extends Cache {
return $data;
}
} else {
+ $sourceId = $file;
// if we are at the root of the mount point we want to return the
// cache information for the source item
- if (!is_int($file) || $file === 0) {
- $file = $this->storage->getSourceId();
+ if (!is_int($sourceId) || $sourceId === 0) {
+ $sourceId = $this->storage->getSourceId();
}
$query = \OC_DB::prepare(
'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,'
. ' `size`, `mtime`, `encrypted`, `unencrypted_size`, `storage_mtime`, `etag`'
. ' FROM `*PREFIX*filecache` WHERE `fileid` = ?');
- $result = $query->execute(array($file));
+ $result = $query->execute(array($sourceId));
$data = $result->fetchRow();
$data['fileid'] = (int)$data['fileid'];
$data['mtime'] = (int)$data['mtime'];
@@ -124,6 +126,7 @@ class Shared_Cache extends Cache {
}
if (!is_int($file) || $file === 0) {
$data['path'] = '';
+ $data['name'] = basename($this->storage->getMountPoint());
$data['is_share_mount_point'] = true;
}
return $data;