]> source.dussan.org Git - nextcloud-server.git/commitdiff
if one public link share was found, we don't have to check it for the other folders
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 29 May 2013 11:12:30 +0000 (13:12 +0200)
committerFlorin Peter <github@florin-peter.de>
Fri, 31 May 2013 10:24:15 +0000 (12:24 +0200)
lib/public/share.php

index c215df5c8ed7faa2f9f5d933886d86d54f264499..afb5bc1491438cb6df712703f110f237bf26d1cf 100644 (file)
@@ -186,24 +186,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'];