From c6b1d66dcdcc5e1da48e728b2a0eb58deac9fee2 Mon Sep 17 00:00:00 2001 From: Martin Kuchynar Date: Fri, 21 Feb 2020 13:17:12 +0100 Subject: [PATCH] Using SelectBox filter value directly, cast value before explode. --- src/DataSource/ArrayDataSource.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DataSource/ArrayDataSource.php b/src/DataSource/ArrayDataSource.php index 3730e3e8..b021c3c3 100644 --- a/src/DataSource/ArrayDataSource.php +++ b/src/DataSource/ArrayDataSource.php @@ -142,11 +142,12 @@ protected function applyFilter($row, Filter $filter) foreach ($condition as $column => $value) { $value = (string) $value; $rowVal = (string) $row[$column]; - if ($filter instanceof FilterText && $filter->isExactSearch()) { + if (($filter instanceof FilterText && $filter->isExactSearch()) + || $filter instanceof SelectBox) { return $rowVal === $value; } - $words = $filter instanceof FilterText && $filter->hasSplitWordsSearch() === false ? [$value] : explode(' ', $value); + $words = $filter instanceof FilterText && $filter->hasSplitWordsSearch() === false ? [$value] : explode(' ', (string) $value); $row_value = strtolower(Strings::toAscii((string) $row[$column]));