6
6
7
7
/**
8
8
* @var \Magento\Review\Block\Customer\ListCustomer $block
9
+ * @var \Magento\Framework\Escaper $escaper
9
10
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
10
11
*/
11
12
@@ -15,36 +16,36 @@ $reviewHelper = $block->getData('reviewHelper');
15
16
<?php if ($ block ->getReviews () && count ($ block ->getReviews ())): ?>
16
17
<div class="table-wrapper reviews">
17
18
<table class="data table table-reviews" id="my-reviews-table">
18
- <caption class="table-caption"><?= $ block ->escapeHtml (__ ('Product Reviews ' )) ?> </caption>
19
+ <caption class="table-caption"><?= $ escaper ->escapeHtml (__ ('Product Reviews ' )) ?> </caption>
19
20
<thead>
20
21
<tr>
21
- <th scope="col" class="col date"><?= $ block ->escapeHtml (__ ('Created ' )) ?> </th>
22
- <th scope="col" class="col item"><?= $ block ->escapeHtml (__ ('Product Name ' )) ?> </th>
23
- <th scope="col" class="col summary"><?= $ block ->escapeHtml (__ ('Rating ' )) ?> </th>
24
- <th scope="col" class="col description"><?= $ block ->escapeHtml (__ ('Review ' )) ?> </th>
22
+ <th scope="col" class="col date"><?= $ escaper ->escapeHtml (__ ('Created ' )) ?> </th>
23
+ <th scope="col" class="col item"><?= $ escaper ->escapeHtml (__ ('Product Name ' )) ?> </th>
24
+ <th scope="col" class="col summary"><?= $ escaper ->escapeHtml (__ ('Rating ' )) ?> </th>
25
+ <th scope="col" class="col description"><?= $ escaper ->escapeHtml (__ ('Review ' )) ?> </th>
25
26
<th scope="col" class="col actions"> </th>
26
27
</tr>
27
28
</thead>
28
29
<tbody>
29
30
<?php foreach ($ block ->getReviews () as $ review ): ?>
30
31
<tr>
31
- <td data-th="<?= $ block ->escapeHtml (__ ('Created ' )) ?> "
32
- class="col date"><?= $ block ->escapeHtml ($ block ->dateFormat ($ review ->getReviewCreatedAt ())) ?>
32
+ <td data-th="<?= $ escaper ->escapeHtml (__ ('Created ' )) ?> "
33
+ class="col date"><?= $ escaper ->escapeHtml ($ block ->dateFormat ($ review ->getReviewCreatedAt ())) ?>
33
34
</td>
34
- <td data-th="<?= $ block ->escapeHtml (__ ('Product Name ' )) ?> " class="col item">
35
+ <td data-th="<?= $ escaper ->escapeHtml (__ ('Product Name ' )) ?> " class="col item">
35
36
<strong class="product-name">
36
- <a href="<?= $ block ->escapeUrl ($ block ->getProductUrl ($ review )) ?> ">
37
- <?= $ block ->escapeHtml ($ review ->getName ()) ?>
37
+ <a href="<?= $ escaper ->escapeUrl ($ block ->getProductUrl ($ review )) ?> ">
38
+ <?= $ escaper ->escapeHtml ($ review ->getName ()) ?>
38
39
</a>
39
40
</strong>
40
41
</td>
41
- <td data-th="<?= $ block ->escapeHtml (__ ('Rating ' )) ?> " class="col summary">
42
+ <td data-th="<?= $ escaper ->escapeHtml (__ ('Rating ' )) ?> " class="col summary">
42
43
<?php if ($ review ->getSum ()): ?>
43
44
<div class="rating-summary">
44
- <span class="label"><span><?= $ block ->escapeHtml (__ ('Rating ' )) ?> :</span></span>
45
+ <span class="label"><span><?= $ escaper ->escapeHtml (__ ('Rating ' )) ?> :</span></span>
45
46
<div class="rating-result"
46
47
title="<?= /* @noEscape */ ((int )$ review ->getSum () / (int )$ review ->getCount ()) ?> %">
47
- <span>
48
+ <span class="rating_ <?= $ escaper -> escapeUrl ( $ review -> getReviewId ()) ?> " >
48
49
<span>
49
50
<?= /* @noEscape */ ((int )$ review ->getSum () / (int )$ review ->getCount ()) ?> %
50
51
</span>
@@ -53,16 +54,16 @@ $reviewHelper = $block->getData('reviewHelper');
53
54
</div>
54
55
<?= /* @noEscape */ $ secureRenderer ->renderStyleAsTag (
55
56
"width: " . /* @noEscape */ ((int )$ review ->getSum () / (int )$ review ->getCount ()) . "%; " ,
56
- 'div.rating-summary div.rating-result>span:first-child '
57
+ 'div.rating-summary div.rating-result>span.rating_ ' . $ escaper -> escapeUrl ( $ review -> getReviewId ())
57
58
) ?>
58
59
<?php endif ; ?>
59
60
</td>
60
- <td data-th="<?= $ block ->escapeHtmlAttr (__ ('Review ' )) ?> " class="col description">
61
+ <td data-th="<?= $ escaper ->escapeHtmlAttr (__ ('Review ' )) ?> " class="col description">
61
62
<?= $ reviewHelper ->getDetailHtml ($ review ->getDetail ()) ?>
62
63
</td>
63
- <td data-th="<?= $ block ->escapeHtmlAttr (__ ('Actions ' )) ?> " class="col actions">
64
- <a href="<?= $ block ->escapeUrl ($ block ->getReviewUrl ($ review )) ?> " class="action more">
65
- <span><?= $ block ->escapeHtml (__ ('See Details ' )) ?> </span>
64
+ <td data-th="<?= $ escaper ->escapeHtmlAttr (__ ('Actions ' )) ?> " class="col actions">
65
+ <a href="<?= $ escaper ->escapeUrl ($ block ->getReviewUrl ($ review )) ?> " class="action more">
66
+ <span><?= $ escaper ->escapeHtml (__ ('See Details ' )) ?> </span>
66
67
</a>
67
68
</td>
68
69
</tr>
@@ -76,12 +77,12 @@ $reviewHelper = $block->getData('reviewHelper');
76
77
</div>
77
78
<?php endif ; ?>
78
79
<?php else : ?>
79
- <div class="message info empty"><span><?= $ block ->escapeHtml (__ ('You have submitted no reviews. ' )) ?> </span></div>
80
+ <div class="message info empty"><span><?= $ escaper ->escapeHtml (__ ('You have submitted no reviews. ' )) ?> </span></div>
80
81
<?php endif ; ?>
81
82
<div class="actions-toolbar">
82
83
<div class="secondary">
83
- <a class="action back" href="<?= $ block ->escapeUrl ($ block ->getBackUrl ()) ?> ">
84
- <span><?= $ block ->escapeHtml (__ ('Back ' )) ?> </span>
84
+ <a class="action back" href="<?= $ escaper ->escapeUrl ($ block ->getBackUrl ()) ?> ">
85
+ <span><?= $ escaper ->escapeHtml (__ ('Back ' )) ?> </span>
85
86
</a>
86
87
</div>
87
88
</div>
0 commit comments