diff options
| author | 2023-07-07 22:36:27 +0200 | |
|---|---|---|
| committer | 2023-07-07 22:36:27 +0200 | |
| commit | f8f163d054110f7e0ff6650fca146b474335f4bd (patch) | |
| tree | dbd831e600bc76ca2830cd417bd52b712ff97309 /app/Models/BooleanSearch.php | |
| parent | 7f9594b8c7d7799f2e5f89328bd5981410db8cf0 (diff) | |
Chore/processing of depreciations and updating code to php72 minimum (#5504)
* processing of depreciations and updating of code to php7.2 minimum
* Autoformat many strange array indenting
And revert a few unwanted changes
---------
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/BooleanSearch.php')
| -rw-r--r-- | app/Models/BooleanSearch.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/Models/BooleanSearch.php b/app/Models/BooleanSearch.php index d4d8a42ab..5cfcd9342 100644 --- a/app/Models/BooleanSearch.php +++ b/app/Models/BooleanSearch.php @@ -8,7 +8,7 @@ class FreshRSS_BooleanSearch { /** @var string */ private $raw_input = ''; /** @var array<FreshRSS_BooleanSearch|FreshRSS_Search> */ - private $searches = array(); + private $searches = []; /** * @phpstan-var 'AND'|'OR'|'AND NOT' @@ -62,6 +62,9 @@ class FreshRSS_BooleanSearch { $fromS = []; $toS = []; foreach ($all_matches as $matches) { + if (empty($matches['search'])) { + continue; + } for ($i = count($matches['search']) - 1; $i >= 0; $i--) { $name = trim($matches['search'][$i]); if (!empty($queries[$name])) { @@ -97,9 +100,12 @@ class FreshRSS_BooleanSearch { $fromS = []; $toS = []; foreach ($all_matches as $matches) { + if (empty($matches['search'])) { + continue; + } for ($i = count($matches['search']) - 1; $i >= 0; $i--) { // Index starting from 1 - $id = intval(trim($matches['search'][$i])) - 1; + $id = (int)(trim($matches['search'][$i])) - 1; if (!empty($queries[$id])) { $fromS[] = $matches[0][$i]; $toS[] = '(' . trim($queries[$id]->getSearch()) . ')'; |
