summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/cache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-04-25 12:28:10 +0200
committerRobin Appelman <icewind@owncloud.com>2014-04-25 12:28:10 +0200
commitc53c4b9791914a7449adc1d73b2e66189100328b (patch)
tree139a1a70e8b49f759f8a2131f139dc27d397a447 /apps/files_sharing/lib/cache.php
parent3fc809dfd80a296d7da922a06f9e13d446b3d3f0 (diff)
downloadnextcloud-server-c53c4b9791914a7449adc1d73b2e66189100328b.tar.gz
nextcloud-server-c53c4b9791914a7449adc1d73b2e66189100328b.zip
fix search by mime for shared single files
Diffstat (limited to 'apps/files_sharing/lib/cache.php')
-rw-r--r--apps/files_sharing/lib/cache.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 67a0410ef76..fa86d55730d 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -86,14 +86,13 @@ class Shared_Cache extends Cache {
public function get($file) {
if (is_string($file)) {
if ($cache = $this->getSourceCache($file)) {
- $path = 'files' . $this->storage->getMountPoint();
- $path .= ($file !== '') ? '/' . $file : '';
$data = $cache->get($this->files[$file]);
$data['displayname_owner'] = \OC_User::getDisplayName($this->storage->getSharedFrom());
- $data['path'] = $path;
+ $data['path'] = '';
if ($file === '') {
$data['is_share_mount_point'] = true;
}
+ $data['uid_owner'] = $this->storage->getOwner($file);
return $data;
}
} else {
@@ -299,6 +298,11 @@ class Shared_Cache extends Cache {
$files = $this->getFolderContents($dir);
// no results?
if (!$files) {
+ // maybe it's a single shared file
+ $file = $this->get('');
+ if (($mimepart && $file['mimepart'] === $mimepart) || ($mimetype && $file['mimetype'] === $mimetype)) {
+ $result[] = $file;
+ }
continue;
}
foreach ($files as $file) {