From 672811c103a352ecb4bc33c2071b9b4493398b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Wed, 29 May 2013 13:12:30 +0200 Subject: [PATCH] if one public link share was found, we don't have to check it for the other folders --- lib/public/share.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/public/share.php b/lib/public/share.php index 58e6131af5..558efb49c0 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'];