Skip to content

Commit

Permalink
Merge pull request #39700 from nextcloud/debt/noid/invitation-respons…
Browse files Browse the repository at this point in the history
…e-close-cursor

fix: close cursor after reading the invitation
  • Loading branch information
nickvergessen committed Aug 11, 2023
2 parents 74dac12 + 378a0f9 commit 03f5bb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/dav/lib/Controller/InvitationResponseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ private function getTokenInformation(string $token) {
$query->select('*')
->from('calendar_invitations')
->where($query->expr()->eq('token', $query->createNamedParameter($token)));
$stmt = $query->execute();
$stmt = $query->executeQuery();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
$stmt->closeCursor();

if (!$row) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ private function buildQueryExpects($token, $return, $time): void {
->method('fetch')
->with(\PDO::FETCH_ASSOC)
->willReturn($return);
$stmt->expects($this->once())
->method('closeCursor');

$function = 'functionToken';
$expr->expects($this->once())
Expand All @@ -490,7 +492,7 @@ private function buildQueryExpects($token, $return, $time): void {
->with($function)
->willReturn($queryBuilder);
$queryBuilder->expects($this->once())
->method('execute')
->method('executeQuery')
->with()
->willReturn($stmt);

Expand Down

0 comments on commit 03f5bb6

Please sign in to comment.