]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not reuse query builder objects in DAV account deletion 36487/head
authorJoas Schilling <coding@schilljs.com>
Wed, 1 Feb 2023 20:49:34 +0000 (21:49 +0100)
committerJoas Schilling <coding@schilljs.com>
Wed, 1 Feb 2023 20:49:34 +0000 (21:49 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/lib/CalDAV/CalDavBackend.php
apps/dav/lib/CardDAV/CardDavBackend.php

index a894b65d756045cbff6f3a54f27dac90a4fbccd0..909a582805996877fb0dadfd2b17669369dd3328 100644 (file)
@@ -897,7 +897,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
                                ->executeStatement();
 
                        $qbDeleteCalendarChanges = $this->db->getQueryBuilder();
-                       $qbDeleteCalendarObjects->delete('calendarchanges')
+                       $qbDeleteCalendarChanges->delete('calendarchanges')
                                ->where($qbDeleteCalendarChanges->expr()->eq('calendarid', $qbDeleteCalendarChanges->createNamedParameter($calendarId)))
                                ->andWhere($qbDeleteCalendarChanges->expr()->eq('calendartype', $qbDeleteCalendarChanges->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)))
                                ->executeStatement();
@@ -905,7 +905,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
                        $this->calendarSharingBackend->deleteAllShares($calendarId);
 
                        $qbDeleteCalendar = $this->db->getQueryBuilder();
-                       $qbDeleteCalendarObjects->delete('calendars')
+                       $qbDeleteCalendar->delete('calendars')
                                ->where($qbDeleteCalendar->expr()->eq('id', $qbDeleteCalendar->createNamedParameter($calendarId)))
                                ->executeStatement();
 
index 03ddb93c08447195d953679f1c85222327d376a6..ab21af1ce1048c25b82a1d2b2e526f1616837f4f 100644 (file)
@@ -452,11 +452,13 @@ class CardDavBackend implements BackendInterface, SyncSupport {
                        ->setParameter('addressbookid', $addressBookId, IQueryBuilder::PARAM_INT)
                        ->executeStatement();
 
+               $query = $this->db->getQueryBuilder();
                $query->delete('addressbookchanges')
                        ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
                        ->setParameter('addressbookid', $addressBookId, IQueryBuilder::PARAM_INT)
                        ->executeStatement();
 
+               $query = $this->db->getQueryBuilder();
                $query->delete('addressbooks')
                        ->where($query->expr()->eq('id', $query->createParameter('id')))
                        ->setParameter('id', $addressBookId, IQueryBuilder::PARAM_INT)
@@ -464,6 +466,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
 
                $this->sharingBackend->deleteAllShares($addressBookId);
 
+               $query = $this->db->getQueryBuilder();
                $query->delete($this->dbCardsPropertiesTable)
                        ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId, IQueryBuilder::PARAM_INT)))
                        ->executeStatement();