Skip to content

Commit 378a0f9

Browse files
committed
fix: close cursor after reading the invitation
Signed-off-by: Daniel Kesselberg <[email protected]>
1 parent a38a86e commit 378a0f9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apps/dav/lib/Controller/InvitationResponseController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ private function getTokenInformation(string $token) {
169169
$query->select('*')
170170
->from('calendar_invitations')
171171
->where($query->expr()->eq('token', $query->createNamedParameter($token)));
172-
$stmt = $query->execute();
172+
$stmt = $query->executeQuery();
173173
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
174+
$stmt->closeCursor();
174175

175176
if (!$row) {
176177
return null;

apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,8 @@ private function buildQueryExpects($token, $return, $time): void {
465465
->method('fetch')
466466
->with(\PDO::FETCH_ASSOC)
467467
->willReturn($return);
468+
$stmt->expects($this->once())
469+
->method('closeCursor');
468470

469471
$function = 'functionToken';
470472
$expr->expects($this->once())
@@ -490,7 +492,7 @@ private function buildQueryExpects($token, $return, $time): void {
490492
->with($function)
491493
->willReturn($queryBuilder);
492494
$queryBuilder->expects($this->once())
493-
->method('execute')
495+
->method('executeQuery')
494496
->with()
495497
->willReturn($stmt);
496498

0 commit comments

Comments
 (0)