aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index e4d728ba4..ada6e9944 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -577,12 +577,20 @@ HTML;
foreach ($booleanSearch->searches() as $filter) {
if ($filter instanceof FreshRSS_BooleanSearch) {
// BooleanSearches are combined by AND (default) or OR or AND NOT (special cases) operators and are recursive
- if ($filter->operator() === 'OR') {
- $ok |= $this->matches($filter);
- } elseif ($filter->operator() === 'AND NOT') {
- $ok &= !$this->matches($filter);
- } else { // AND
- $ok &= $this->matches($filter);
+ switch ($filter->operator()) {
+ case 'OR':
+ $ok |= $this->matches($filter);
+ break;
+ case 'OR NOT':
+ $ok |= !$this->matches($filter);
+ break;
+ case 'AND NOT':
+ $ok &= !$this->matches($filter);
+ break;
+ case 'AND':
+ default:
+ $ok &= $this->matches($filter);
+ break;
}
} elseif ($filter instanceof FreshRSS_Search) {
// Searches are combined by OR and are not recursive