summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-08-07 18:18:40 +0200
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2013-09-19 21:08:32 +0300
commit392c6b6832edfc37a2956ef3a77fab6020a7a746 (patch)
tree4dc96265cb7abc2d6dbcfaa46e80034a124fc05a /apps
parent27511d9187a5ffd4d5a087602a9c648e9ec1c06e (diff)
downloadnextcloud-server-392c6b6832edfc37a2956ef3a77fab6020a7a746.tar.gz
nextcloud-server-392c6b6832edfc37a2956ef3a77fab6020a7a746.zip
return fixed path, skip shared files outside of 'files'
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/cache.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 6386f1d2c60..a4402464481 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -254,9 +254,12 @@ class Shared_Cache extends Cache {
$result = \OC_DB::executeAudited($sql, array_merge(array($pattern), $chunk));
while ($row = $result->fetchRow()) {
- $row['mimetype'] = $this->getMimetype($row['mimetype']);
- $row['mimepart'] = $this->getMimetype($row['mimepart']);
- $files[] = $row;
+ if (substr($row['path'], 0, 6)==='files/') {
+ $row['path'] = substr($row['path'],6); // remove 'files/' from path as it's relative to '/Shared'
+ $row['mimetype'] = $this->getMimetype($row['mimetype']);
+ $row['mimepart'] = $this->getMimetype($row['mimepart']);
+ $files[] = $row;
+ } // else skip results out of the files folder
}
}
return $files;