summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-06-09 15:01:57 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-06-09 15:01:57 +0200
commitfc3ad7d5f7acb018329b22d5120c03cd07feecd6 (patch)
treeefa1958da450eb72ae93bb54dd3fe23a21aba682 /apps/files_sharing
parentb928305bb30ade5635a203408090f4ae376278ba (diff)
parentbb67acff9137a96f8ed002da6c8edf7aae8a7ec8 (diff)
downloadnextcloud-server-fc3ad7d5f7acb018329b22d5120c03cd07feecd6.tar.gz
nextcloud-server-fc3ad7d5f7acb018329b22d5120c03cd07feecd6.zip
Merge pull request #25 from nextcloud/downstream-160608
Downstream 2016-06-08
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Cache.php2
-rw-r--r--apps/files_sharing/lib/sharedstorage.php18
2 files changed, 19 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 82d885a8ef3..a0519cadbaa 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -81,7 +81,7 @@ class Cache extends CacheJail {
}
protected function formatCacheEntry($entry) {
- $path = $entry['path'];
+ $path = isset($entry['path']) ? $entry['path'] : '';
$entry = parent::formatCacheEntry($entry);
$sharePermissions = $this->storage->getPermissions($path);
if (isset($entry['permissions'])) {
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 965c4d36cad..b5b5e416884 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -415,4 +415,22 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
return $this->sourceStorage;
}
+ public function file_get_contents($path) {
+ $info = [
+ 'target' => $this->getMountPoint() . '/' . $path,
+ 'source' => $this->getSourcePath($path),
+ ];
+ \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info);
+ return parent::file_get_contents($path);
+ }
+
+ public function file_put_contents($path, $data) {
+ $info = [
+ 'target' => $this->getMountPoint() . '/' . $path,
+ 'source' => $this->getSourcePath($path),
+ ];
+ \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info);
+ return parent::file_put_contents($path, $data);
+ }
+
}