Skip to content

Commit bffa9cf

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 a24f1c2 commit bffa9cf

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
@@ -274,7 +274,7 @@ public function getConfiguration()
274274
'autofocus' => true,
275275
'resultPageUrl' => $this->getCatalogSearchHelper()->getResultUrl(),
276276
'request' => [
277-
'query' => htmlspecialchars(html_entity_decode($query)),
277+
'query' => htmlspecialchars(html_entity_decode((string)$query)),
278278
'refinementKey' => $refinementKey,
279279
'refinementValue' => $refinementValue,
280280
'categoryId' => $categoryId,

0 commit comments

Comments
 (0)