Skip to content

Commit a41315c

Browse files
committed
MAGETWO-44555: Exception in Advanced Search if used special symbols
- Fixed static tests
1 parent bcb8c14 commit a41315c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/internal/Magento/Framework/Search/Request/Cleaner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private function cleanFilter($filterName)
172172
case FilterInterface::TYPE_RANGE:
173173
$keys = ['from', 'to'];
174174
foreach ($keys as $key) {
175-
if (isset($filter[$key]) && preg_match('/^\$(.+)\$$/si', $filter[$key], $matches)) {
175+
if (isset($filter[$key]) && preg_match('/^\$(.+)\$$/si', $filter[$key])) {
176176
unset($this->requestData['filters'][$filterName][$key]);
177177
}
178178
}

lib/internal/Magento/Framework/Search/Test/Unit/Request/BinderTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@ public function testBind()
5252
$expectedResult = [
5353
'dimensions' => ['scope' => ['value' => 'default']],
5454
'queries' => ['query' => ['value' => 'match_query', 'is_bind' => true]],
55-
'filters' => ['filter' => ['from' => 'filter_from', 'to' => 'filter_to', 'value' => 'filter_value', 'is_bind' => true]],
55+
'filters' => [
56+
'filter' => [
57+
'from' => 'filter_from',
58+
'to' => 'filter_to',
59+
'value' => 'filter_value',
60+
'is_bind' => true
61+
]
62+
],
5663
'aggregations' => ['price' => ['method' => 'filter_method', 'is_bind' => true]],
5764
'from' => 1,
5865
'size' => 10,

0 commit comments

Comments
 (0)