Issue Bug Closed

#90165Incorrect comparison in indexed_search SearchController do not set configured languageUid

form4 GmbH & Co. KG 01/21/20, 15:59 updated 04/01/20, 21:14

Description

The indexed_search SearchController->initialize() function creates the wrong languageUid in search settings.

The condition

if ($searchData['languageUid'] ?? '' === 'current')

is true, if the $searchData[‘languageUid’] is set. The value of the $searchData[‘languageUid’] doesn’t matter.

This is the case, because the

'' === 'current'

comparission is evaluated first, than the

$searchData['languageUid'] ?? false

operator.

The correct condition would be

if (($searchData['languageUid'] ?? '') === 'current')

Reviews 2