4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
+ // phpcs:disable Magento2.Files.LineLength, Generic.Files.LineLength
8
+
7
9
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
10
+ /** @var Magento\Framework\Escaper $escaper */
8
11
?>
9
12
<?php $ _giftMessage = false ;
10
13
switch ($ block ->getCheckoutType ()):
@@ -61,9 +64,7 @@ switch ($block->getCheckoutType()):
61
64
name="giftmessage[quote][<?= (int ) $ block ->getEntity ()->getId () ?> ][from]"
62
65
id="gift-message-whole-from"
63
66
title="<?= $ block ->escapeHtmlAttr (__ ('From ' )) ?> "
64
- value="<?= /* @noEscape */ $ block
65
- ->getEscaped ($ block ->getMessage ()->getSender (), $ block ->getDefaultFrom ())
66
- ?> "
67
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ()->getSender () ?? '' , $ block ->getDefaultFrom ()) ?> "
67
68
class="input-text">
68
69
</div>
69
70
</div>
@@ -75,9 +76,8 @@ switch ($block->getCheckoutType()):
75
76
<input type="text"
76
77
name="giftmessage[quote][<?= (int ) $ block ->getEntity ()->getId () ?> ][to]"
77
78
id="gift-message-whole-to" title="<?= $ block ->escapeHtmlAttr (__ ('To ' )) ?> "
78
- value="<?= /* @noEscape */ $ block
79
- ->getEscaped ($ block ->getMessage ()->getRecipient (), $ block ->getDefaultTo ())
80
- ?> " class="input-text">
79
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ()->getRecipient () ?? '' , $ block ->getDefaultTo ()) ?> "
80
+ class="input-text">
81
81
</div>
82
82
</div>
83
83
<div class="field text">
@@ -87,7 +87,7 @@ switch ($block->getCheckoutType()):
87
87
<div class="control">
88
88
<textarea id="gift-message-whole-message" class="input-text"
89
89
name="giftmessage[quote][<?= (int )$ block ->getEntity ()->getId ()?> ][message]"
90
- title="<?= $ block ->escapeHtmlAttr (__ ('Message ' )) ?> " rows="5" cols="10"><?= /* @noEscape */ $ block -> getEscaped ($ block ->getMessage ()->getMessage ()) ?> </textarea>
90
+ title="<?= $ block ->escapeHtmlAttr (__ ('Message ' )) ?> " rows="5" cols="10"><?= $ escaper -> escapeHtml ($ block ->getMessage ()->getMessage ()) ?> </textarea>
91
91
</div>
92
92
</div>
93
93
</fieldset>
@@ -165,7 +165,7 @@ script;
165
165
value=
166
166
"<?= /* @noEscape */
167
167
$ block ->getEscaped (
168
- $ block ->getMessage ($ _item )->getSender (),
168
+ $ block ->getMessage ($ _item )->getSender () ?? '' ,
169
169
$ block ->getDefaultFrom ()
170
170
) ?> " class="input-text">
171
171
</div>
@@ -179,8 +179,7 @@ script;
179
179
name="giftmessage[quote_item][<?= (int ) $ _item ->getId () ?> ][to]"
180
180
id="gift-message-<?= (int ) $ _item ->getId () ?> -to"
181
181
title="<?= $ block ->escapeHtmlAttr (__ ('To ' )) ?> "
182
- value="<?= /* @noEscape */ $ block ->getEscaped ($ block
183
- ->getMessage ($ _item )->getRecipient (), $ block ->getDefaultTo ()) ?> "
182
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ($ _item )->getRecipient () ?? '' , $ block ->getDefaultTo ()) ?> "
184
183
class="input-text">
185
184
</div>
186
185
</div>
@@ -194,7 +193,7 @@ script;
194
193
name="giftmessage[quote_item][<?= (int ) $ _item ->getId ()
195
194
?> ][message]"
196
195
title="<?= $ block ->escapeHtmlAttr (__ ('Message ' )) ?> "
197
- rows="5" cols="40"><?= /* @noEscape */ $ block -> getEscaped ($ block ->getMessage ($ _item )->getMessage ()) ?> </textarea>
196
+ rows="5" cols="40"><?= $ escaper -> escapeHtml ($ block ->getMessage ($ _item )->getMessage ()) ?> </textarea>
198
197
</div>
199
198
</div>
200
199
</fieldset>
@@ -221,6 +220,7 @@ script;
221
220
</dt>
222
221
</dl>
223
222
</fieldset>
223
+ <?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
224
224
<script type="text/x-magento-init">
225
225
{
226
226
"#allow_gift_options, #allow_gift_options_for_order, #allow_gift_options_for_items": {
@@ -291,8 +291,8 @@ script;
291
291
->getId () ?> ][from]"
292
292
id="gift-message-<?= (int ) $ block ->getEntity ()->getId () ?> -from"
293
293
title="<?= $ block ->escapeHtmlAttr (__ ('From ' )) ?> "
294
- value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ()
295
- -> getSender (), $ block -> getDefaultFrom ()) ?> " class="input-text">
294
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ()-> getSender () ?? '' , $ block -> getDefaultFrom ()) ?> "
295
+ class="input-text">
296
296
</div>
297
297
</div>
298
298
<div class="field to">
@@ -304,8 +304,8 @@ script;
304
304
->getId () ?> ][to]"
305
305
id="gift-message-<?= (int ) $ block ->getEntity ()->getId () ?> -to"
306
306
title="<?= $ block ->escapeHtmlAttr (__ ('To ' )) ?> "
307
- value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ()
308
- -> getRecipient (), $ block -> getDefaultTo ()) ?> " class="input-text">
307
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ()-> getRecipient () ?? '' , $ block -> getDefaultTo ()) ?> "
308
+ class="input-text">
309
309
</div>
310
310
</div>
311
311
<div class="field text">
@@ -316,7 +316,7 @@ script;
316
316
<textarea id="gift-message-<?= (int ) $ block ->getEntity ()->getId () ?> -message"
317
317
class="input-text" name="giftmessage[quote_address][<?= (int ) $ block
318
318
->getEntity ()->getId () ?> ][message]"
319
- title="<?= $ block ->escapeHtmlAttr (__ ('Message ' )) ?> " rows="5" cols="40"><?= /* @noEscape */ $ block -> getEscaped ($ block ->getMessage ()->getMessage ()) ?> </textarea>
319
+ title="<?= $ block ->escapeHtmlAttr (__ ('Message ' )) ?> " rows="5" cols="40"><?= $ escaper -> escapeHtml ($ block ->getMessage ()->getMessage ()) ?> </textarea>
320
320
</div>
321
321
</div>
322
322
</fieldset>
@@ -391,9 +391,8 @@ script;
391
391
name="giftmessage[quote_address_item][<?= (int ) $ _item ->getId ()
392
392
?> ][from]" id="gift-message-<?= (int ) $ _item ->getId () ?> -from"
393
393
title="<?= $ block ->escapeHtmlAttr (__ ('From ' )) ?> "
394
- value="<?= /* @noEscape */ $ block ->getEscaped ($ block
395
- ->getMessage ($ _item )->getSender (), $ block ->getDefaultFrom ())
396
- ?> " class="input-text">
394
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ($ _item )->getSender () ?? '' , $ block ->getDefaultFrom ()) ?> "
395
+ class="input-text">
397
396
</div>
398
397
</div>
399
398
<div class="field to">
@@ -405,10 +404,8 @@ script;
405
404
name="giftmessage[quote_address_item][<?= (int ) $ _item ->getId ()
406
405
?> ][to]" id="gift-message-<?= (int ) $ _item ->getId () ?> -to"
407
406
title="<?= $ block ->escapeHtmlAttr (__ ('To ' )) ?> "
408
- value=
409
- "<?= /* @noEscape */ $ block ->getEscaped ($ block
410
- ->getMessage ($ _item )->getRecipient (), $ block ->getDefaultTo ())
411
- ?> " class="input-text">
407
+ value="<?= /* @noEscape */ $ block ->getEscaped ($ block ->getMessage ($ _item )->getRecipient () ?? '' , $ block ->getDefaultTo ()) ?> "
408
+ class="input-text">
412
409
</div>
413
410
</div>
414
411
<div class="field text">
@@ -421,7 +418,7 @@ script;
421
418
name="giftmessage[quote_address_item][<?= (int ) $ _item
422
419
->getId () ?> ][message]"
423
420
title="<?= $ block ->escapeHtmlAttr (__ ('Message ' )) ?> " rows="5"
424
- cols="10"><?= /* @noEscape */ $ block -> getEscaped ($ block ->getMessage ($ _item )->getMessage ()) ?> </textarea>
421
+ cols="10"><?= $ escaper -> escapeHtml ($ block ->getMessage ($ _item )->getMessage ()) ?> </textarea>
425
422
</div>
426
423
</div>
427
424
</fieldset>
@@ -437,7 +434,8 @@ script;
437
434
</dt>
438
435
</dl>
439
436
</fieldset>
440
- <?php $ entityId = (int ) $ block ->getEntity ()->getId (); ?>
437
+ <?php $ entityId = (int ) $ block ->getEntity ()->getId (); ?>
438
+ <?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
441
439
<script type="text/x-magento-init">
442
440
{
443
441
"#allow_gift_options_<?= /* @noEscape */ $ entityId ?> , #allow_gift_options_for_order_<?= /* @noEscape */ $ entityId ?> , #allow_gift_options_for_items_<?= /* @noEscape */ $ entityId ?> ": {
@@ -449,6 +447,7 @@ script;
449
447
break ;
450
448
endswitch ;
451
449
if ($ _giftMessage ): ?>
450
+ <?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
452
451
<script type="text/x-magento-init">
453
452
{
454
453
"#shipping_method_form": {
0 commit comments