diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 6e43e203b2..44babc73a7 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -246,7 +246,7 @@ class OC_SHARE { * @param $uid_shared_with Array of users to unshare the item from */ public static function unshare($source, $uid_shared_with) { - $query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE source SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?"); + $query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?"); foreach ($uid_shared_with as $uid) { $query->execute(array(strlen($source), $source, $uid, OC_USER::getUser())); } diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index c26423594f..8efccbc769 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -77,6 +77,9 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE { global $FAKEDIRS; $path = $this->datadir.$path; $sharedItems = OC_SHARE::getItemsInFolder($path); + if (empty($sharedItems)) { + return false; + } foreach ($sharedItems as $item) { // If item is in the root of the shared storage provider add it to the fakedirs if (dirname($item['target'])."/" == $path) {