diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-29 13:12:30 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-29 13:12:30 +0200 |
commit | 672811c103a352ecb4bc33c2071b9b4493398b30 (patch) | |
tree | 632ed772f67ab4fd794a67150d5cb6d9eb6c4cb8 /lib/public | |
parent | b44192f3668ae2e8e9685479fa62a78cfc5500ba (diff) | |
download | nextcloud-server-672811c103a352ecb4bc33c2071b9b4493398b30.tar.gz nextcloud-server-672811c103a352ecb4bc33c2071b9b4493398b30.zip |
if one public link share was found, we don't have to check it for the other folders
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index 58e6131af58..558efb49c0b 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -185,24 +185,26 @@ class Share { } //check for public link shares - $query = \OC_DB::prepare( - 'SELECT share_with + if (!$publicShare) { + $query = \OC_DB::prepare( + 'SELECT share_with FROM `*PREFIX*share` WHERE item_source = ? AND share_type = ?' - ); + ); - $result = $query->execute(array($source, self::SHARE_TYPE_LINK)); + $result = $query->execute(array($source, self::SHARE_TYPE_LINK)); - if (\OC_DB::isError($result)) { - \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR); - } + if (\OC_DB::isError($result)) { + \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR); + } - if ($result->fetchRow()) { - $publicShare = true; + if ($result->fetchRow()) { + $publicShare = true; + } } - + // let's get the parent for the next round $meta = $cache->get((int)$source); $parent = $meta['parent']; |