From f8f163d054110f7e0ff6650fca146b474335f4bd Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Fri, 7 Jul 2023 22:36:27 +0200 Subject: 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 Co-authored-by: Alexandre Alapetite --- app/Models/BooleanSearch.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/Models/BooleanSearch.php') 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 */ - 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()) . ')'; -- cgit v1.2.3