Skip to content

Commit

Permalink
ShareByMailProvider: getAccessList: set correct value for 'public'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ASerbinski committed Mar 21, 2024
1 parent dfe8e45 commit 37d9142
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/sharebymail/lib/ShareByMailProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,10 @@ public function getAccessList($nodes, $currentAccess): array {
));
$cursor = $qb->executeQuery();

$public = $cursor->rowCount() > 0;
$public = false;
$mail = [];
while ($row = $cursor->fetch()) {
$public = true;
if ($currentAccess === false) {
$mail[] = $row['share_with'];
} else {
Expand Down

0 comments on commit 37d9142

Please sign in to comment.