diff --git a/src/Core/Search/Discussion/Gambit/AuthorGambit.php b/src/Core/Search/Discussion/Gambit/AuthorGambit.php index 640e7b752..62e399cd3 100644 --- a/src/Core/Search/Discussion/Gambit/AuthorGambit.php +++ b/src/Core/Search/Discussion/Gambit/AuthorGambit.php @@ -45,10 +45,14 @@ class AuthorGambit extends AbstractRegexGambit throw new LogicException('This gambit can only be applied on a DiscussionSearch'); } - $username = trim($matches[1], '"'); + $usernames = trim($matches[1], '"'); + $usernames = explode(',', $usernames); - $id = $this->users->getIdForUsername($username); + $ids = []; + foreach($usernames as $username) { + $ids[] = $this->users->getIdForUsername($username); + } - $search->getQuery()->where('start_user_id', $negate ? '!=' : '=', $id); + $search->getQuery()->whereIn('start_user_id', $ids, 'and', $negate); } }