summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Db/ItemMapper.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Db/ItemMapper.php b/lib/Db/ItemMapper.php
index 0ff2ca036..bcf5aa1ec 100644
--- a/lib/Db/ItemMapper.php
+++ b/lib/Db/ItemMapper.php
@@ -147,13 +147,14 @@ class ItemMapper extends NewsMapper
$sql = 'UPDATE `*PREFIX*news_items` ' .
'SET unread = ? ' .
', `last_modified` = ? ' .
- 'WHERE `feed_id` IN (' .
+ 'WHERE ((`feed_id` IN (' .
'SELECT `id` FROM `*PREFIX*news_feeds` ' .
'WHERE `user_id` = ? ' .
') ' .
- 'AND `shared_by` = \'\' ' .
+ 'AND `shared_by` = \'\') ' .
+ 'OR `shared_with` = ?) ' .
'AND `id` <= ?';
- $params = [false, $time, $userId, $highestItemId];
+ $params = [false, $time, $userId, $userId, $highestItemId];
$this->execute($sql, $params);
}