diff options
-rw-r--r-- | apps/files_sharing/public.php | 2 | ||||
-rw-r--r-- | lib/private/share/share.php | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 5c75168d9a9..4320c105103 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -114,7 +114,7 @@ if (isset($path)) { $files = $_GET['files']; $files_list = json_decode($files); // in case we get only a single file - if ($files_list === NULL ) { + if (!is_array($files_list)) { $files_list = array($files); } OC_Files::get($path, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD'); diff --git a/lib/private/share/share.php b/lib/private/share/share.php index e580acc19c6..5314e09b8de 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -293,9 +293,10 @@ class Share extends \OC\Share\Constants { public static function getItemSharedWithUser($itemType, $itemSource, $user) { $shares = array(); + $fileDependend = false; - $column = ($itemType === 'file' || $itemType === 'folder') ? 'file_source' : 'item_source'; if ($itemType === 'file' || $itemType === 'folder') { + $fileDependend = true; $column = 'file_source'; $where = 'INNER JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid` WHERE'; } else { @@ -303,7 +304,7 @@ class Share extends \OC\Share\Constants { $where = 'WHERE'; } - $select = self::createSelectStatement(self::FORMAT_NONE, true); + $select = self::createSelectStatement(self::FORMAT_NONE, $fileDependend); $where .= ' `' . $column . '` = ? AND `item_type` = ? '; $arguments = array($itemSource, $itemType); |