Skip to content

Commit 35f8c47

Browse files
PromIncdamcou
authored andcommitted
Update Configuration.php
typecast the $query variable to comply with the PHP 8 standards of [html_entity_decode](https://www.php.net/manual/en/function.html-entity-decode.php) If the search results page (`/catalogsearch/result`) is requested and the `q` query parameter is not present the page will error. The code errors when generating the `algoliaConfig` JS variable which means that Algolia can not be instantiated. This means no products show on the page - the expected result is that a blank search query would be performed and thus a set of products would be displayed.
1 parent 0b75f3f commit 35f8c47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Block/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function getConfiguration()
254254
'autofocus' => true,
255255
'resultPageUrl' => $this->getCatalogSearchHelper()->getResultUrl(),
256256
'request' => [
257-
'query' => htmlspecialchars(html_entity_decode($query)),
257+
'query' => htmlspecialchars(html_entity_decode((string)$query)),
258258
'refinementKey' => $refinementKey,
259259
'refinementValue' => $refinementValue,
260260
'categoryId' => $categoryId,

0 commit comments

Comments
 (0)