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 <adam@serbinski.com>
pull/32631/head
Adam Serbinski 2024-03-21 15:26:30 +07:00 committed by Adam Serbinski
parent 01e32340af
commit f45eb75e3d
1 changed files with 2 additions and 1 deletions

@ -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 {