Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Domain/Search/ResultSet/Facets/UrlFacetContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function getActiveFacetValuesByName(string $facetName): array
$activeFacets = array_keys($activeFacets);
}
array_map(function($activeFacet) use (&$values, $facetName) {
$parts = explode(':', $activeFacet, 2);
$parts = explode(':', (string)$activeFacet, 2);
if ($parts[0] === $facetName) {
$values[] = $parts[1];
}
Expand Down Expand Up @@ -325,7 +325,7 @@ public function removeAllFacetValuesByName(string $facetName): UrlFacetContainer
}

$facetValues = array_filter($facetValues, function($facetNameValue) use ($facetName) {
$parts = explode(':', $facetNameValue, 2);
$parts = explode(':', (string)$facetNameValue, 2);
return $parts[0] !== $facetName;
}, $filterOptions);

Expand Down
5 changes: 2 additions & 3 deletions Classes/Domain/Search/SearchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,14 @@ public function getRawUserQuery()

/**
* Method to check if the query string is an empty string
* (also empty string or whitespaces only are handled as empty).
* (also whitespaces only are handled as empty).
*
* When no query string is set (null) the method returns false.
* @return bool
*/
public function getRawUserQueryIsEmptyString()
{
$path = $this->prefixWithNamespace('q');
$query = $this->argumentsAccessor->get($path, null);
$query = $this->getRawUserQuery();

if ($query === null) {
return false;
Expand Down
10 changes: 10 additions & 0 deletions Classes/Query/Modifier/Faceting.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ protected function getFilterParts(array $facetConfiguration, string $facetName,
*/
protected function getFiltersByFacetName(array $resultParameters, array $allFacets): array
{
// validate $resultParameters['filter'] to be an array of string
if (!is_array($resultParameters['filter'])) {
return [];
}
foreach ($resultParameters['filter'] as $filter) {
if (!is_string($filter)) {
return [];
}
}

// format for filter URL parameter:
// tx_solr[filter]=$facetName0:$facetValue0,$facetName1:$facetValue1,$facetName2:$facetValue2
$filters = array_map('rawurldecode', $resultParameters['filter']);
Expand Down