]> source.dussan.org Git - nextcloud-server.git/commitdiff
update routine was lacking where statements :see_no_evil:
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 1 Feb 2016 21:45:52 +0000 (22:45 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Tue, 2 Feb 2016 13:30:35 +0000 (14:30 +0100)
lib/private/comments/manager.php

index 23add3fd2c36496edfa8c50e7bd03639a83eeb63..28bd3b0916a276db74ad329c5423431a099be49c 100644 (file)
@@ -629,9 +629,15 @@ class Manager implements ICommentsManager {
                $affectedRows = $qb
                        ->update('comments_read_markers')
                        ->set('user_id',         $values['user_id'])
-                       ->set('marker_datetime', $values['marker_datetime'], 'datetime')
+                       ->set('marker_datetime', $values['marker_datetime'])
                        ->set('object_type',     $values['object_type'])
                        ->set('object_id',       $values['object_id'])
+                       ->where($qb->expr()->eq('user_id', $qb->createParameter('user_id')))
+                       ->andWhere($qb->expr()->eq('object_type', $qb->createParameter('object_type')))
+                       ->andWhere($qb->expr()->eq('object_id', $qb->createParameter('object_id')))
+                       ->setParameter('user_id', $user->getUID(), \PDO::PARAM_STR)
+                       ->setParameter('object_type', $objectType, \PDO::PARAM_STR)
+                       ->setParameter('object_id', $objectId, \PDO::PARAM_STR)
                        ->execute();
 
                if ($affectedRows > 0) {