Skip to content

Commit ece4383

Browse files
committed
MC-16618: Eliminate @escapeNotVerified in Sales-related Modules
- Resolve redundant *1 - Use shorthand for ternary statements
1 parent 0de669a commit ece4383

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

app/code/Magento/Sales/view/frontend/templates/email/items/creditmemo/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<?php foreach ($block->getItemOptions() as $option) : ?>
1717
<dt><strong><em><?= $block->escapeHtml($option['label']) ?></em></strong></dt>
1818
<dd>
19-
<?= /* @noEscape */ nl2br($option['value']) ?>
19+
<?= /* @noEscape */ nl2br($block->escapeHtml($option['value'])) ?>
2020
</dd>
2121
<?php endforeach; ?>
2222
</dl>
@@ -27,7 +27,7 @@
2727
<?php endif; ?>
2828
<?= $block->escapeHtml($_item->getDescription()) ?>
2929
</td>
30-
<td class="item-qty"><?= (int) $_item->getQty() * 1 ?></td>
30+
<td class="item-qty"><?= (int) $_item->getQty() ?></td>
3131
<td class="item-price">
3232
<?= /* @noEscape */ $block->getItemPrice($_item) ?>
3333
</td>

app/code/Magento/Sales/view/frontend/templates/email/items/invoice/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<?php foreach ($block->getItemOptions() as $option) : ?>
1616
<dt><strong><em><?= $block->escapeHtml($option['label']) ?></em></strong></dt>
1717
<dd>
18-
<?= /* @noEscape */ nl2br($option['value']) ?>
18+
<?= /* @noEscape */ nl2br($block->escapeHtml($option['value'])) ?>
1919
</dd>
2020
<?php endforeach; ?>
2121
</dl>
@@ -26,7 +26,7 @@
2626
<?php endif; ?>
2727
<?= $block->escapeHtml($_item->getDescription()) ?>
2828
</td>
29-
<td class="item-qty"><?= (int) $_item->getQty() * 1 ?></td>
29+
<td class="item-qty"><?= (int) $_item->getQty() ?></td>
3030
<td class="item-price">
3131
<?= /* @noEscape */ $block->getItemPrice($_item->getOrderItem()) ?>
3232
</td>

app/code/Magento/Sales/view/frontend/templates/email/items/order/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $_order = $_item->getOrder();
2121
<?php foreach ($block->getItemOptions() as $option) : ?>
2222
<dt><strong><em><?= $block->escapeHtml($option['label']) ?></em></strong></dt>
2323
<dd>
24-
<?= /* @noEscape */ nl2br($option['value']) ?>
24+
<?= /* @noEscape */ nl2br($block->escapeHtml($option['value'])) ?>
2525
</dd>
2626
<?php endforeach; ?>
2727
</dl>
@@ -32,7 +32,7 @@ $_order = $_item->getOrder();
3232
<?php endif; ?>
3333
<?= $block->escapeHtml($_item->getDescription()) ?>
3434
</td>
35-
<td class="item-qty"><?= (int) $_item->getQtyOrdered() * 1 ?></td>
35+
<td class="item-qty"><?= (int) $_item->getQtyOrdered() ?></td>
3636
<td class="item-price">
3737
<?= /* @noEscape */ $block->getItemPrice($_item) ?>
3838
</td>

app/code/Magento/Sales/view/frontend/templates/email/items/shipment/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ $_item = $block->getItem() ?>
2626
<?php endif; ?>
2727
<?= $block->escapeHtml($_item->getDescription()) ?>
2828
</td>
29-
<td class="item-qty"><?= (int) $_item->getQty() * 1 ?></td>
29+
<td class="item-qty"><?= (int) $_item->getQty() ?></td>
3030
</tr>

app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
?>
88
<?php $_shipment = $block->getShipment() ?>
9-
<?php $_order = $block->getOrder() ?>
9+
<?php
10+
/* @var \Magento\Sales\Model\Order $_order */
11+
$_order = $block->getOrder() ?>
1012
<?php if ($_shipment && $_order) : ?>
1113
<?php $trackCollection = $_order->getTracksCollection($_shipment->getId()) ?>
1214
<?php if ($trackCollection) : ?>

app/code/Magento/Sales/view/frontend/templates/order/creditmemo/items/renderer/default.phtml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
</dd>
3030
<?php else : ?>
3131
<dd>
32-
<?= $block->escapeHtml(
33-
(isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])
34-
) ?>
32+
<?= $block->escapeHtml($_option['print_value'] ?? $_option['value']) ?>
3533
</dd>
3634
<?php endif; ?>
3735
<?php endforeach; ?>
@@ -59,7 +57,7 @@
5957
<td class="col price" data-th="<?= $block->escapeHtml(__('Price')) ?>">
6058
<?= $block->getItemPriceHtml() ?>
6159
</td>
62-
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>"><?= (int) $_item->getQty() * 1 ?></td>
60+
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>"><?= (int) $_item->getQty() ?></td>
6361
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
6462
<?= $block->getItemRowTotalHtml() ?>
6563
</td>

app/code/Magento/Sales/view/frontend/templates/order/history.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
?>
1111
<?php $_orders = $block->getOrders(); ?>
1212
<?= $block->getChildHtml('info') ?>
13-
<?php if ($_orders && !empty($_orders)) : ?>
13+
<?php if ($_orders && count($_orders)) : ?>
1414
<div class="table-wrapper orders-history">
1515
<table class="data table table-order-items history" id="my-orders-table">
1616
<caption class="table-caption"><?= $block->escapeHtml(__('Orders')) ?></caption>

app/code/Magento/Sales/view/frontend/templates/order/invoice/items/renderer/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<?php endif; ?>
2929
</dd>
3030
<?php else : ?>
31-
<dd><?= $block->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value'])) ?></dd>
31+
<dd><?= $block->escapeHtml($_option['print_value'] ?? $_option['value']) ?></dd>
3232
<?php endif; ?>
3333
<?php endforeach; ?>
3434
</dl>
@@ -44,7 +44,7 @@
4444
<?= $block->getItemPriceHtml() ?>
4545
</td>
4646
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty Invoiced')) ?>">
47-
<span class="qty summary"><?= (int) $_item->getQty()*1 ?></span>
47+
<span class="qty summary"><?= (int) $_item->getQty() ?></span>
4848
</td>
4949
<td class="col subtotal" data-th="<?= $block->escapeHtml(__('Subtotal')) ?>">
5050
<?= $block->getItemRowTotalHtml() ?>

app/code/Magento/Sales/view/frontend/templates/order/items/renderer/default.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $_item = $block->getItem();
2525
</dd>
2626
<?php else : ?>
2727
<dd>
28-
<?= /* @noEscape */ nl2br($block->escapeHtml((isset($_option['print_value']) ? $_option['print_value'] : $_option['value']))) ?>
28+
<?= /* @noEscape */ nl2br($block->escapeHtml($_option['print_value'] ?? $_option['value'])) ?>
2929
</dd>
3030
<?php endif; ?>
3131
<?php endforeach; ?>
@@ -46,25 +46,25 @@ $_item = $block->getItem();
4646
<?php if ($block->getItem()->getQtyOrdered() > 0) : ?>
4747
<li class="item">
4848
<span class="title"><?= $block->escapeHtml(__('Ordered')) ?></span>
49-
<span class="content"><?= (int) $block->getItem()->getQtyOrdered()*1 ?></span>
49+
<span class="content"><?= (int) $block->getItem()->getQtyOrdered() ?></span>
5050
</li>
5151
<?php endif; ?>
5252
<?php if ($block->getItem()->getQtyShipped() > 0) : ?>
5353
<li class="item">
5454
<span class="title"><?= $block->escapeHtml(__('Shipped')) ?></span>
55-
<span class="content"><?= (int) $block->getItem()->getQtyShipped()*1 ?></span>
55+
<span class="content"><?= (int) $block->getItem()->getQtyShipped() ?></span>
5656
</li>
5757
<?php endif; ?>
5858
<?php if ($block->getItem()->getQtyCanceled() > 0) : ?>
5959
<li class="item">
6060
<span class="title"><?= $block->escapeHtml(__('Canceled')) ?></span>
61-
<span class="content"><?= (int) $block->getItem()->getQtyCanceled()*1 ?></span>
61+
<span class="content"><?= (int) $block->getItem()->getQtyCanceled() ?></span>
6262
</li>
6363
<?php endif; ?>
6464
<?php if ($block->getItem()->getQtyRefunded() > 0) : ?>
6565
<li class="item">
6666
<span class="title"><?= $block->escapeHtml(__('Refunded')) ?></span>
67-
<span class="content"><?= (int) $block->getItem()->getQtyRefunded()*1 ?></span>
67+
<span class="content"><?= (int) $block->getItem()->getQtyRefunded() ?></span>
6868
</li>
6969
<?php endif; ?>
7070
</ul>

app/code/Magento/Sales/view/frontend/templates/order/shipment/items/renderer/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
<?= $block->escapeHtml($_item->getDescription()) ?>
4040
</td>
4141
<td class="col sku" data-th="<?= $block->escapeHtml(__('SKU')) ?>"><?= /* @noEscape */ $block->prepareSku($block->getSku()) ?></td>
42-
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty Shipped')) ?>"><?= (int) $_item->getQty()*1 ?></td>
42+
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty Shipped')) ?>"><?= (int) $_item->getQty() ?></td>
4343
</tr>

0 commit comments

Comments
 (0)