From f45eb75e3de1d82695f38f49f28e69278b7f9dbb Mon Sep 17 00:00:00 2001 From: Adam Serbinski Date: Thu, 21 Mar 2024 15:26:30 -0400 Subject: [PATCH] ShareByMailProvider: getAccessList: set correct value for 'public' 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 --- apps/sharebymail/lib/ShareByMailProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index e7f1db25a9b..f1bb3fe94ca 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -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 { -- 2.39.5