]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: close cursor after reading the invitation 39700/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Thu, 3 Aug 2023 14:34:56 +0000 (16:34 +0200)
committerDaniel <mail@danielkesselberg.de>
Thu, 10 Aug 2023 19:45:57 +0000 (21:45 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
apps/dav/lib/Controller/InvitationResponseController.php
apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php

index 3cf2e6586215a7c850e18955aaa922175278fc0a..0ec630883dcb4999fec5b88d4dba5038c72f9ea1 100644 (file)
@@ -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;
index aac79844aacac9200fb0427e26c73d84f7be9f39..2d9132ddccb6db3394ab8af758243d2501758d85 100644 (file)
@@ -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);