diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2023-08-03 16:34:56 +0200 |
---|---|---|
committer | Daniel <mail@danielkesselberg.de> | 2023-08-10 21:45:57 +0200 |
commit | 378a0f983739bf2a2a2a8202fc4277dea2b84bfa (patch) | |
tree | bd9e523bb8f9d63f7e19a386fb1f9c570d4cbfa6 /apps | |
parent | a38a86e5c42660da3db9a6b2a94da2bc1b329e88 (diff) | |
download | nextcloud-server-378a0f983739bf2a2a2a8202fc4277dea2b84bfa.tar.gz nextcloud-server-378a0f983739bf2a2a2a8202fc4277dea2b84bfa.zip |
fix: close cursor after reading the invitation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps')
-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); |