1
0
mirror of https://github.com/flarum/core.git synced 2025-10-20 19:27:14 +02:00

Perform visibility checks on notification subjects at the query level

This will prevent a notification from being seen by a user if its
subject is deleted or undergoes some kind of permission change (eg.
a discussion is moved into a private tag)

ref #1380
This commit is contained in:
Toby Zerner
2018-11-11 16:58:08 +10:30
parent 17fdc0ebe0
commit 6d14d0c39b
4 changed files with 36 additions and 4 deletions

View File

@@ -437,6 +437,7 @@ class User extends AbstractModel
->whereIn('type', $this->getAlertableNotificationTypes())
->whereNull('read_at')
->where('is_deleted', false)
->whereSubjectVisibleTo($this)
->get();
}