Merge pull request #39700 from nextcloud/debt/noid/invitation-response-close-cursor

fix: close cursor after reading the invitation
pull/39820/head
Joas Schilling 10 months ago committed by GitHub
commit 03f5bb68a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -169,8 +169,9 @@ class InvitationResponseController extends Controller {
$query->select('*') $query->select('*')
->from('calendar_invitations') ->from('calendar_invitations')
->where($query->expr()->eq('token', $query->createNamedParameter($token))); ->where($query->expr()->eq('token', $query->createNamedParameter($token)));
$stmt = $query->execute(); $stmt = $query->executeQuery();
$row = $stmt->fetch(\PDO::FETCH_ASSOC); $row = $stmt->fetch(\PDO::FETCH_ASSOC);
$stmt->closeCursor();
if (!$row) { if (!$row) {
return null; return null;

@ -465,6 +465,8 @@ EOF;
->method('fetch') ->method('fetch')
->with(\PDO::FETCH_ASSOC) ->with(\PDO::FETCH_ASSOC)
->willReturn($return); ->willReturn($return);
$stmt->expects($this->once())
->method('closeCursor');
$function = 'functionToken'; $function = 'functionToken';
$expr->expects($this->once()) $expr->expects($this->once())
@ -490,7 +492,7 @@ EOF;
->with($function) ->with($function)
->willReturn($queryBuilder); ->willReturn($queryBuilder);
$queryBuilder->expects($this->once()) $queryBuilder->expects($this->once())
->method('execute') ->method('executeQuery')
->with() ->with()
->willReturn($stmt); ->willReturn($stmt);

Loading…
Cancel
Save