From 4cf328e3b941139f3a41a8a3631f3c74544eb094 Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <mtgap@owncloud.com>
Date: Wed, 1 May 2013 21:15:32 -0400
Subject: [PATCH] Don't return links for shared files if disabled

---
 lib/public/share.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/public/share.php b/lib/public/share.php
index 1b6f5d05f1..2847f9e5ec 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -960,6 +960,10 @@ class Share {
 				$queryArgs = array($itemType);
 			}
 		}
+		if (\OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
+			$where .= ' AND `share_type` != ?';
+			$queryArgs[] = self::SHARE_TYPE_LINK;
+		}
 		if (isset($shareType)) {
 			// Include all user and group items
 			if ($shareType == self::$shareTypeUserAndGroups && isset($shareWith)) {
-- 
GitLab