Commit 9ee71ce2 authored by Daniel Hettler's avatar Daniel Hettler Committed by Christian Kuhn
Browse files

[BUGFIX] indexed_search: PHP 8 array key exists check

Another PHP 8 sanitation checking for array
key existance.

Resolves: #98040
Releases: main, 11.5
Change-Id: I3f76f619fa9d58b1ce8c6b63314b617be10f8ac5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75315

Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 3e58f43b
......@@ -357,7 +357,7 @@ class SearchController extends ActionController
// Browsing box
if ($resultData['count']) {
// could we get this in the view?
if ($this->searchData['group'] === 'sections' && $freeIndexUid <= 0) {
if (($this->searchData['group'] ?? '') === 'sections' && $freeIndexUid <= 0) {
$resultSectionsCount = count($this->resultSections);
$result['sectionText'] = sprintf(LocalizationUtility::translate('result.' . ($resultSectionsCount > 1 ? 'inNsections' : 'inNsection'), 'IndexedSearch') ?? '', $resultSectionsCount);
}
......@@ -410,7 +410,7 @@ class SearchController extends ActionController
}
$resultRows = $newResultRows;
$this->resultSections = [];
if ($freeIndexUid <= 0 && $this->searchData['group'] === 'sections') {
if ($freeIndexUid <= 0 && ($this->searchData['group'] ?? '') === 'sections') {
$rl2flag = str_starts_with($this->searchData['sections'], 'rl');
$sections = [];
foreach ($resultRows as $row) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment