summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-09-21 21:32:09 +0200
committerBart Visscher <bartv@thisnet.nl>2012-09-21 21:32:09 +0200
commitee77ef86d30942cf9b72ce1a496dbf595807198e (patch)
tree704c9cb71c266e33c76a14d53df13dfeae0f083b
parent4f4498e0d66adc1c74a6923e443da06b5e58e5df (diff)
downloadnextcloud-server-ee77ef86d30942cf9b72ce1a496dbf595807198e.tar.gz
nextcloud-server-ee77ef86d30942cf9b72ce1a496dbf595807198e.zip
Check mimetype filter in file share backend
-rw-r--r--apps/files_sharing/lib/share/file.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index b120cc167f3..6409c43e134 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -72,8 +72,14 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
// Only 1 item should come through for this format call
return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions']);
} else if ($format == self::FORMAT_FILE_APP) {
+ if (isset($parameters['mimetype_filter'])) {
+ $mimetype_filter = $parameters['mimetype_filter'];
+ }
$files = array();
foreach ($items as $item) {
+ if (isset($mimetype_filter) && strpos($item['mimetype'], $mimetype_filter) !== 0) {
+ continue;
+ }
$file = array();
$file['id'] = $item['file_source'];
$file['path'] = $item['file_target'];
@@ -116,4 +122,4 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
return array();
}
-} \ No newline at end of file
+}