summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2023-08-03 16:34:56 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-08-11 16:37:37 +0000
commitf10972e2fe33c7917a2265e9d42c8b478bc0dc38 (patch)
tree04dc05e59cf442f50983ca538634129f46891a1b /apps/dav
parentacd4e5dc0fc23c2e53c90525492bbe8218c15323 (diff)
downloadnextcloud-server-f10972e2fe33c7917a2265e9d42c8b478bc0dc38.tar.gz
nextcloud-server-f10972e2fe33c7917a2265e9d42c8b478bc0dc38.zip
fix: close cursor after reading the invitation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Controller/InvitationResponseController.php3
-rw-r--r--apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php4
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php
index a3607949874..b6013d7b5ad 100644
--- a/apps/dav/lib/Controller/InvitationResponseController.php
+++ b/apps/dav/lib/Controller/InvitationResponseController.php
@@ -166,8 +166,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);