]> source.dussan.org Git - nextcloud-server.git/commitdiff
ShareByMailProvider: getAccessList: set correct value for 'public' 32631/head
authorAdam Serbinski <adam@serbinski.com>
Thu, 21 Mar 2024 19:26:30 +0000 (15:26 -0400)
committerAdam Serbinski <37986043+ASerbinski@users.noreply.github.com>
Thu, 21 Mar 2024 22:25:31 +0000 (18:25 -0400)
PDOStatement::rowCount behavior is undefined for SELECT statements
for some database types, therefore manually set the value for 'public'
based on actual results fetched.

Signed-off-by: Adam Serbinski <adam@serbinski.com>
apps/sharebymail/lib/ShareByMailProvider.php

index e7f1db25a9b8ba6a89d008e10df9700fc57475d2..f1bb3fe94ca2379a214ff6e12d4967e5d68589d1 100644 (file)
@@ -1108,9 +1108,10 @@ class ShareByMailProvider implements IShareProvider {
                        ));
                $cursor = $qb->executeQuery();
 
-               $public = $cursor->rowCount() > 0;
+               $public = false;
                $mail = [];
                while ($row = $cursor->fetch()) {
+                       $public = true;
                        if ($currentAccess === false) {
                                $mail[] = $row['share_with'];
                        } else {