Skip to content

Commit 48bd391

Browse files
committed
Convert long form tags with echo to use short-echo tags #1563
Manual short-echo tag updates for echo calls script didn't catch; sniff did though!
1 parent c03b511 commit 48bd391

File tree

22 files changed

+40
-40
lines changed

22 files changed

+40
-40
lines changed

app/code/Magento/Braintree/view/adminhtml/templates/grid/tooltip.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
/**
88
* @var \Magento\Backend\Block\Template $block
99
*/
10-
echo $block->escapeHtml($block->getData('tooltip_content'));
10+
?>
11+
<?= $block->escapeHtml($block->getData('tooltip_content'));

app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ $config = [
2121

2222
?>
2323
<div data-mage-init='<?= /* @noEscape */ json_encode($config) ?>'
24-
class="paypal checkout paypal-logo braintree-paypal-logo<?php
25-
/* @noEscape */ echo $block->getContainerId(); ?>-container">
24+
class="paypal checkout paypal-logo braintree-paypal-logo<?= /* @noEscape */ $block->getContainerId() ?>-container">
2625
<button data-currency="<?= /* @noEscape */ $block->getCurrency() ?>"
2726
data-locale="<?= /* @noEscape */ $block->getLocale() ?>"
2827
data-amount="<?= /* @noEscape */ $block->getAmount() ?>"

app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option/search.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
*/
66

77
/** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search */
8-
echo $block->getChildHtml();
8+
?>
9+
<?= $block->getChildHtml();

app/code/Magento/Catalog/view/base/templates/product/price/configured_price.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $priceLabel = ($block->getPriceLabel() !== null)
1414
: '';
1515
?>
1616
<p class="price-as-configured">
17-
<?php /* @escapeNotVerified */ echo $block->renderAmount($configuredPrice->getAmount(), [
17+
<?= /* @escapeNotVerified */ $block->renderAmount($configuredPrice->getAmount(), [
1818
'display_label' => $priceLabel,
1919
'price_id' => $block->getPriceId('product-price-'),
2020
'price_type' => 'finalPrice',

app/code/Magento/Customer/view/adminhtml/templates/tab/view.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
*/
1010

1111
/** @var $block \Magento\Customer\Block\Adminhtml\Edit\Tab\View */
12-
echo $block->getChildHtml();
12+
?>
13+
<?= $block->getChildHtml();

app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
/** @var \Magento\Customer\Block\CustomerData $block */
88
?>
99
<script type="text/x-magento-init">
10-
<?php
11-
/* @noEscape */ echo $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
10+
<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
1211
'*' => ['Magento_Customer/js/customer-data' => [
1312
'sectionLoadUrl' => $block->getCustomerDataUrl('customer/section/load'),
1413
'cookieLifeTime' => $block->getCookieLifeTime(),

app/code/Magento/Customer/view/frontend/templates/js/section-config.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
/** @var \Magento\Customer\Block\SectionConfig $block */
88
?>
99
<script type="text/x-magento-init">
10-
<?php
11-
/* @noEscape */ echo $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
10+
<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
1211
'*' => ['Magento_Customer/js/section-config' => [
1312
'sections' => $block->getSections(),
1413
'clientSideSections' => $block->getClientSideSections(),

app/code/Magento/Dhl/view/adminhtml/templates/unitofmeasure.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
dimensionUnit = "(<?= $block->escapeHtml($block->getCm()) ?>)";
1818
dhlUnitOfMeasureNote = "<?= $block->escapeHtml($block->getDivideOrderWeightNoteKg()) ?>";
1919
}
20-
$$('[for="carriers_dhl_height"]')[0].innerHTML = "<?php
21-
echo $block->escapeHtml($block->getHeight()); ?> " + dimensionUnit;
22-
$$('[for="carriers_dhl_depth"]')[0].innerHTML = "<?php
23-
echo $block->escapeHtml($block->getDepth()); ?> " + dimensionUnit;
24-
$$('[for="carriers_dhl_width"]')[0].innerHTML = "<?php
25-
echo $block->escapeHtml($block->getWidth()); ?> " + dimensionUnit;
20+
$$('[for="carriers_dhl_height"]')[0].innerHTML = "<?=
21+
$block->escapeHtml($block->getHeight()); ?> " + dimensionUnit;
22+
$$('[for="carriers_dhl_depth"]')[0].innerHTML = "<?=
23+
$block->escapeHtml($block->getDepth()); ?> " + dimensionUnit;
24+
$$('[for="carriers_dhl_width"]')[0].innerHTML = "<?=
25+
$block->escapeHtml($block->getWidth()); ?> " + dimensionUnit;
2626

2727
$("carriers_dhl_divide_order_weight").next().down().innerHTML = dhlUnitOfMeasureNote;
2828
}

app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828

2929
<a class="action-default"
3030
data-paypal-button="true"
31-
href="<?php
32-
/* @noEscape */ echo $block->escapeUrl($block->getSandboxButtonUrl(). '?' . $block->getQuery());
33-
?>"
31+
href="<?= /* @noEscape */ $block->escapeUrl($block->getSandboxButtonUrl(). '?' . $block->getQuery()) ?>"
3432
target="PPFrame"><?= $block->escapeHtml($block->getSandboxButtonLabel()) ?></a>
3533
</div>
3634
</div>

app/code/Magento/ProductVideo/view/adminhtml/templates/product/edit/base_image.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
data-max-file-size="<?= /* @escapeNotVerified */ $fileMaxSize ?>"
2424
>
2525
<div class="image image-placeholder">
26-
<input type="file" name="image" data-url="<?php
27-
/* @escapeNotVerified */ echo $uploadUrl;?>" multiple="multiple" />
26+
<input type="file" name="image" data-url="<?= /* @escapeNotVerified */ $uploadUrl ?>" multiple="multiple" />
2827
<img class="spacer" src="<?= /* @escapeNotVerified */ $spacerImage ?>"/>
2928
<p class="image-placeholder-text"><?= /* @escapeNotVerified */ $imagePlaceholderText ?></p>
3029
</div>

app/code/Magento/Security/view/adminhtml/templates/session/activity.phtml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ $sessionInfoCollection = $block->getSessionInfoCollection();
5454
<?php
5555
if ($block->areMultipleSessionsActive()): ?>
5656
data-mage-init='{"confirmRedirect":{
57-
"message": "<?php
58-
echo $block->escapeJs(__('Are you sure that you want to log out all other sessions?'))
57+
"message": "<?=
58+
$block->escapeJs(__('Are you sure that you want to log out all other sessions?'))
5959
?>",
60-
"url":"<?php
61-
echo $block->escapeJs($block->escapeUrl($block->getUrl('security/session/logoutAll')))
60+
"url":"<?=
61+
$block->escapeJs($block->escapeUrl($block->getUrl('security/session/logoutAll')))
6262
?>"
6363
}}'
6464
<?php
@@ -69,7 +69,6 @@ $sessionInfoCollection = $block->getSessionInfoCollection();
6969
</button>
7070
</div>
7171

72-
<div><?php
73-
echo $block->escapeHtml(__('This computer is using IP address %1.', $block->getRemoteIp())) ?></div>
72+
<div><?= $block->escapeHtml(__('This computer is using IP address %1.', $block->getRemoteIp())) ?></div>
7473
</div>
7574
</div>

app/code/Magento/Tax/Test/Unit/Model/TaxClass/Source/CustomerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function dataProviderGetAllOptionsNameIntegrity()
286286
'value' => ['value' => 5, 'label' => 'comment <!-- comment -->'],
287287
],
288288
[
289-
'value' => ['value' => 6, 'label' => 'php tag <?php echo "2"; ?>'],
289+
'value' => ['value' => 6, 'label' => 'php tag <?= "2"; ?>'],
290290
],
291291

292292
];

app/code/Magento/Tax/Test/Unit/Model/TaxClass/Source/ProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function dataProviderGetAllOptionsNameIntegrity()
207207
'value' => ['value' => 5, 'label' => 'comment <!-- comment -->'],
208208
],
209209
[
210-
'value' => ['value' => 6, 'label' => 'php tag <?php echo "2"; ?>'],
210+
'value' => ['value' => 6, 'label' => 'php tag <?= "2"; ?>'],
211211
],
212212

213213
];

app/code/Magento/Theme/view/frontend/templates/html/absolute_footer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<?php /* @escapeNotVerified */ echo $block->getMiscellaneousHtml();
7+
<?= /* @escapeNotVerified */ $block->getMiscellaneousHtml();

app/code/Magento/Theme/view/frontend/templates/template.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
* See COPYING.txt for license details.
55
*/
66
/** @var $block \Magento\Framework\View\Element\Template */
7-
echo $block->getChildHtml('', false);
7+
?>
8+
<?= $block->getChildHtml('', false);

app/code/Magento/Vault/view/frontend/templates/customer_account/credit_card.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ $ccNumberView = $block->escapeHtml($block->getNumberLast4Digits());
4343
"modalClass": "my-credit-cards-popup",
4444
"toggleEvent": "click",
4545
"title": "<?= $block->escapeHtml(__('Delete')) ?>",
46-
"content": "Are you sure you want to delete this card: <?php
47-
/* @noEscape */ echo $ccNumberView
46+
"content": "Are you sure you want to delete this card: <?=
47+
/* @noEscape */ $ccNumberView
4848
?>?"
4949
}
5050
}'>

app/code/Magento/Wishlist/view/frontend/templates/addto.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<script type="text/x-magento-init">
1010
{
1111
"body": {
12-
"addToWishlist": <?php /* @noEscape */ echo $this->helper(\Magento\Framework\Json\Helper\Data::class)
12+
"addToWishlist": <?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)
1313
->jsonEncode($block->getWishlistOptions());
1414
?>
1515
}

app/code/Magento/Wishlist/view/frontend/templates/messages/addProductSuccessMessage.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
/** @var \Magento\Framework\View\Element\Template $block */
88
?>
99

10-
<?php
11-
echo $block->escapeHtml(__('%1 has been added to your Wish List.', $block->getData('product_name'))) ?> <?= $block->escapeHtml(__('Click <a href="%1">here</a> to continue shopping.', $block->getData('referer')), ['a']);
10+
<?= $block->escapeHtml(__('%1 has been added to your Wish List.', $block->getData('product_name'))) ?> <?= $block->escapeHtml(__('Click <a href="%1">here</a> to continue shopping.', $block->getData('referer')), ['a']);

dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Inspection/_files/words_finder/buffy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
echo 'At the young age of 15, Buffy Summers was chosen to hunt vampires, demons, and the forces of darkness.';
6+
?>
7+
<?= 'At the young age of 15, Buffy Summers was chosen to hunt vampires, demons, and the forces of darkness.';

dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Inspection/_files/words_finder/interview_with_the_vampire.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
echo 'A man tells his epic life story: love, betrayal, loneliness, and hunger.';
6+
?>
7+
<?= 'A man tells his epic life story: love, betrayal, loneliness, and hunger.';

dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Inspection/_files/words_finder/twilight/eclipse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
echo 'As a string of mysterious killings grips Seattle, Bella, whose high school graduation is fast approaching,
6+
?>
7+
<?= 'As a string of mysterious killings grips Seattle, Bella, whose high school graduation is fast approaching,
78
is forced to choose between her love for vampire Edward and her friendship with demon Jacob.';

dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Inspection/_files/words_finder/twilight/newmoon.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
echo 'Vampire Edward leaves Bella after an attack that nearly claimed her life, and in her depression she falls into
6+
?>
7+
<?= 'Vampire Edward leaves Bella after an attack that nearly claimed her life, and in her depression she falls into
78
yet another paranormal relationship - this time with demon Jacob Black.';

0 commit comments

Comments
 (0)