|
7 | 7 | /** |
8 | 8 | * @var \Magento\Review\Block\View $block |
9 | 9 | * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer |
| 10 | + * @var \Magento\Framework\Escaper $escaper |
10 | 11 | */ |
11 | 12 | ?> |
12 | 13 | <?php if ($block->getProductData()->getId()): ?> |
13 | 14 | <div class="product-review"> |
14 | 15 | <div class="page-title-wrapper"> |
15 | | - <h1><?= $block->escapeHtml(__('Review Details')) ?></h1> |
| 16 | + <h1><?= $escaper->escapeHtml(__('Review Details')) ?></h1> |
16 | 17 | </div> |
17 | 18 | <div class="product-img-box"> |
18 | | - <a href="<?= $block->escapeUrl($block->getProductData()->getProductUrl()) ?>"> |
19 | | - <?= $block->getImage($block->getProductData(), 'product_base_image', ['class' => 'product-image'])->toHtml() |
| 19 | + <a href="<?= $escaper->escapeUrl($block->getProductData()->getProductUrl()) ?>"> |
| 20 | + <?= $block->getImage($block->getProductData(), 'product_base_image', [ |
| 21 | + 'class' => 'product-image'])->toHtml() |
20 | 22 | ?> |
21 | 23 | </a> |
22 | 24 | <?php if ($block->getRating() && $block->getRating()->getSize()): ?> |
23 | | - <p><?= $block->escapeHtml(__('Average Customer Rating')) ?>:</p> |
| 25 | + <p><?= $escaper->escapeHtml(__('Average Customer Rating')) ?>:</p> |
24 | 26 | <?= $block->getReviewsSummaryHtml($block->getProductData()) ?> |
25 | 27 | <?php endif; ?> |
26 | 28 | </div> |
27 | 29 | <div class="details"> |
28 | | - <h3 class="product-name"><?= $block->escapeHtml($block->getProductData()->getName()) ?></h3> |
| 30 | + <h3 class="product-name"><?= $escaper->escapeHtml($block->getProductData()->getName()) ?></h3> |
29 | 31 | <?php if ($block->getRating() && $block->getRating()->getSize()): ?> |
30 | | - <h4><?= $block->escapeHtml(__('Product Rating:')) ?></h4> |
| 32 | + <h4><?= $escaper->escapeHtml(__('Product Rating:')) ?></h4> |
31 | 33 | <div class="table-wrapper"> |
32 | 34 | <table class="data-table review-summary-table"> |
33 | | - <caption class="table-caption"><?= $block->escapeHtml(__('Product Rating')) ?></caption> |
| 35 | + <caption class="table-caption"><?= $escaper->escapeHtml(__('Product Rating')) ?></caption> |
34 | 36 | <?php foreach ($block->getRating() as $_rating): ?> |
35 | 37 | <?php if ($_rating->getPercent()): ?> |
36 | 38 | <?php $rating = ceil($_rating->getPercent()) ?> |
37 | 39 | <tr> |
38 | 40 | <td class="label" width="10%"> |
39 | | - <?= $block->escapeHtml(__($_rating->getRatingCode())) ?> |
| 41 | + <?= $escaper->escapeHtml(__($_rating->getRatingCode())) ?> |
40 | 42 | </td> |
41 | 43 | <td class="value"> |
42 | 44 | <?php $ratingId = $_rating->getRatingId() ?> |
43 | 45 | <div class="rating-summary item" |
44 | | - id="rating-div-<?= $block->escapeHtml($ratingId) ?>"> |
| 46 | + id="rating-div-<?= $escaper->escapeHtml($ratingId) ?>"> |
45 | 47 | <div class="rating-result" title="<?= /* @noEscape */ $rating ?>%"> |
46 | | - <span> |
| 48 | + <span style="width: <?= /* @noEscape */ $rating ?>%;"> |
47 | 49 | <span><?= /* @noEscape */ $rating ?>%</span> |
48 | 50 | </span> |
49 | 51 | </div> |
50 | | - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( |
51 | | - "width:" . /* @noEscape */ $rating . "%", |
52 | | - 'div#rating-div-'.$_rating->getRatingId(). |
53 | | - '>div.rating-result>span:first-child' |
54 | | - ) ?> |
55 | 52 | </div> |
56 | 53 | </td> |
57 | 54 | </tr> |
|
61 | 58 | </div> |
62 | 59 | <?php endif; ?> |
63 | 60 | <p class="date"> |
64 | | - <?= $block->escapeHtml( |
| 61 | + <?= $escaper->escapeHtml( |
65 | 62 | __('Product Review (submitted on %1):', $block->dateFormat($block->getReviewData()->getCreatedAt())) |
66 | 63 | ) ?> |
67 | 64 | </p> |
68 | | - <p><?= /* @noEscape */ nl2br($block->escapeHtml($block->getReviewData()->getDetail())) ?></p> |
| 65 | + <p><?= /* @noEscape */ nl2br($escaper->escapeHtml($block->getReviewData()->getDetail())) ?></p> |
69 | 66 | </div> |
70 | 67 | <div class="actions"> |
71 | 68 | <div class="secondary"> |
72 | | - <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>"> |
73 | | - <span><?= $block->escapeHtml(__('Back to Product Reviews')) ?></span> |
| 69 | + <a class="action back" href="<?= $escaper->escapeUrl($block->getBackUrl()) ?>"> |
| 70 | + <span><?= $escaper->escapeHtml(__('Back to Product Reviews')) ?></span> |
74 | 71 | </a> |
75 | 72 | </div> |
76 | 73 | </div> |
|
0 commit comments