diff options
| author | 2025-06-29 11:09:08 +0200 | |
|---|---|---|
| committer | 2025-06-29 11:09:08 +0200 | |
| commit | c8bbf355342985c83054c6c36c6538a780ab509e (patch) | |
| tree | 87286cac4e98769b3a14308e042abdd4d83153e4 /app/Models/Entry.php | |
| parent | 7c57f38008136202ba7b38e3154ac87be4eefb68 (diff) | |
Add search operator `c:` for categories (#7696)
* Add search operator `c:` for categories
fix https://github.com/FreshRSS/FreshRSS/discussions/7692
Allow searching for e.g. `c:23,34`
Diffstat (limited to 'app/Models/Entry.php')
| -rw-r--r-- | app/Models/Entry.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 66c05a830..190b435c8 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -642,6 +642,12 @@ HTML; if ($ok && $filter->getNotFeedIds() !== null) { $ok &= !in_array($this->feedId, $filter->getNotFeedIds(), true); } + if ($ok && $filter->getCategoryIds() !== null) { + $ok &= in_array($this->feed()?->categoryId(), $filter->getCategoryIds(), true); + } + if ($ok && $filter->getNotCategoryIds() !== null) { + $ok &= !in_array($this->feed()?->categoryId(), $filter->getNotCategoryIds(), true); + } if ($ok && $filter->getAuthor() !== null) { foreach ($filter->getAuthor() as $author) { $ok &= stripos(implode(';', $this->authors), $author) !== false; |
