Skip to content

Commit

Permalink
Merge pull request #192 from romainruaud/fix_autocomplete-special-chars
Browse files Browse the repository at this point in the history
Fixup html entities decoding in autocomplete providers.
  • Loading branch information
afoucret authored Nov 9, 2016
2 parents 6661da0 + f80c422 commit dd3659d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ private function addCategoryData($data)

$documentSource = $category->getDocumentSource();

$title = $documentSource['name'];
if (is_array($title)) {
$title = current($title);
}

$categoryData = [
'title' => $documentSource['name'],
'title' => html_entity_decode($title),
'url' => $this->getCategoryUrl($category),
'breadcrumb' => $this->getCategoryBreadcrumb($category),
];
Expand Down Expand Up @@ -151,7 +156,7 @@ private function getCategoryBreadcrumb(\Magento\Catalog\Model\Category $category

$breadcrumb = [];
foreach ($rawPath as $categoryId) {
$breadcrumb[] = $this->getCategoryNameById($categoryId, $category->getStoreId());
$breadcrumb[] = html_entity_decode($this->getCategoryNameById($categoryId, $category->getStoreId()));
}

return $breadcrumb;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function addProductData($data)
$product = $data['product'];

$productData = [
'title' => $product->getName(),
'title' => html_entity_decode($product->getName()),
'image' => $this->getImageUrl($product),
'url' => $product->getProductUrl(),
'price' => $product->getFinalPrice(),
Expand Down

0 comments on commit dd3659d

Please sign in to comment.