Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions app/code/Magento/Search/view/frontend/templates/term.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

/**
* @var \Magento\Search\Block\Term $block
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
*/
use Magento\Framework\Escaper;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Magento\Search\Block\Term;

/** @var Escaper $escaper */
/** @var Term $block */
/** @var SecureHtmlRenderer $secureRenderer */
?>
<?php if (count($block->getTerms()) > 0): ?>
<ul class="search-terms">
<?php foreach ($block->getTerms() as $_term): ?>
<li id="term-<?= /* @noEscape */ $_term->getId() ?>" class="item">
<a href="<?= $block->escapeUrl($block->getSearchUrl($_term)) ?>">
<?= $block->escapeHtml($_term->getQueryText()) ?>
<a href="<?= $escaper->escapeUrl($block->getSearchUrl($_term)) ?>">
<?= $escaper->escapeHtml($_term->getQueryText()) ?>
</a>
</li>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
Expand All @@ -25,6 +29,6 @@
</ul>
<?php else: ?>
<div class="message notice">
<div><?= $block->escapeHtml(__('There are no search terms available.')) ?></div>
<div><?= $escaper->escapeHtml(__('There are no search terms available.')) ?></div>
</div>
<?php endif; ?>