diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-08-11 18:00:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 18:00:11 +0200 |
commit | 03f5bb68a33551d282c66072a940c8b906fc811b (patch) | |
tree | a102ec30f761ecf551dd5541851b15e2a7afdcae | |
parent | 74dac12be6f57c05124fac9292860736bbd8480a (diff) | |
parent | 378a0f983739bf2a2a2a8202fc4277dea2b84bfa (diff) | |
download | nextcloud-server-03f5bb68a33551d282c66072a940c8b906fc811b.tar.gz nextcloud-server-03f5bb68a33551d282c66072a940c8b906fc811b.zip |
Merge pull request #39700 from nextcloud/debt/noid/invitation-response-close-cursor
fix: close cursor after reading the invitation
-rw-r--r-- | apps/dav/lib/Controller/InvitationResponseController.php | 3 | ||||
-rw-r--r-- | apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php index 3cf2e658621..0ec630883dc 100644 --- a/apps/dav/lib/Controller/InvitationResponseController.php +++ b/apps/dav/lib/Controller/InvitationResponseController.php @@ -169,8 +169,9 @@ class InvitationResponseController extends Controller { $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; diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php index aac79844aac..2d9132ddccb 100644 --- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php +++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php @@ -465,6 +465,8 @@ EOF; ->method('fetch') ->with(\PDO::FETCH_ASSOC) ->willReturn($return); + $stmt->expects($this->once()) + ->method('closeCursor'); $function = 'functionToken'; $expr->expects($this->once()) @@ -490,7 +492,7 @@ EOF; ->with($function) ->willReturn($queryBuilder); $queryBuilder->expects($this->once()) - ->method('execute') + ->method('executeQuery') ->with() ->willReturn($stmt); |