Skip to content

Commit

Permalink
Convert long form tags with echo to use short-echo tags #1563
Browse files Browse the repository at this point in the history
Manual short-echo tag updates for echo calls script didn't catch; sniff did though!
  • Loading branch information
davidalger committed Jun 9, 2017
1 parent c03b511 commit 48bd391
Show file tree
Hide file tree
Showing 22 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
/**
* @var \Magento\Backend\Block\Template $block
*/
echo $block->escapeHtml($block->getData('tooltip_content'));
?>
<?= $block->escapeHtml($block->getData('tooltip_content'));
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ $config = [

?>
<div data-mage-init='<?= /* @noEscape */ json_encode($config) ?>'
class="paypal checkout paypal-logo braintree-paypal-logo<?php
/* @noEscape */ echo $block->getContainerId(); ?>-container">
class="paypal checkout paypal-logo braintree-paypal-logo<?= /* @noEscape */ $block->getContainerId() ?>-container">
<button data-currency="<?= /* @noEscape */ $block->getCurrency() ?>"
data-locale="<?= /* @noEscape */ $block->getLocale() ?>"
data-amount="<?= /* @noEscape */ $block->getAmount() ?>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
*/

/** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search */
echo $block->getChildHtml();
?>
<?= $block->getChildHtml();
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $priceLabel = ($block->getPriceLabel() !== null)
: '';
?>
<p class="price-as-configured">
<?php /* @escapeNotVerified */ echo $block->renderAmount($configuredPrice->getAmount(), [
<?= /* @escapeNotVerified */ $block->renderAmount($configuredPrice->getAmount(), [
'display_label' => $priceLabel,
'price_id' => $block->getPriceId('product-price-'),
'price_type' => 'finalPrice',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
*/

/** @var $block \Magento\Customer\Block\Adminhtml\Edit\Tab\View */
echo $block->getChildHtml();
?>
<?= $block->getChildHtml();
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
/** @var \Magento\Customer\Block\CustomerData $block */
?>
<script type="text/x-magento-init">
<?php
/* @noEscape */ echo $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
'*' => ['Magento_Customer/js/customer-data' => [
'sectionLoadUrl' => $block->getCustomerDataUrl('customer/section/load'),
'cookieLifeTime' => $block->getCookieLifeTime(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
/** @var \Magento\Customer\Block\SectionConfig $block */
?>
<script type="text/x-magento-init">
<?php
/* @noEscape */ echo $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
<?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode([
'*' => ['Magento_Customer/js/section-config' => [
'sections' => $block->getSections(),
'clientSideSections' => $block->getClientSideSections(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
dimensionUnit = "(<?= $block->escapeHtml($block->getCm()) ?>)";
dhlUnitOfMeasureNote = "<?= $block->escapeHtml($block->getDivideOrderWeightNoteKg()) ?>";
}
$$('[for="carriers_dhl_height"]')[0].innerHTML = "<?php
echo $block->escapeHtml($block->getHeight()); ?> " + dimensionUnit;
$$('[for="carriers_dhl_depth"]')[0].innerHTML = "<?php
echo $block->escapeHtml($block->getDepth()); ?> " + dimensionUnit;
$$('[for="carriers_dhl_width"]')[0].innerHTML = "<?php
echo $block->escapeHtml($block->getWidth()); ?> " + dimensionUnit;
$$('[for="carriers_dhl_height"]')[0].innerHTML = "<?=
$block->escapeHtml($block->getHeight()); ?> " + dimensionUnit;
$$('[for="carriers_dhl_depth"]')[0].innerHTML = "<?=
$block->escapeHtml($block->getDepth()); ?> " + dimensionUnit;
$$('[for="carriers_dhl_width"]')[0].innerHTML = "<?=
$block->escapeHtml($block->getWidth()); ?> " + dimensionUnit;

$("carriers_dhl_divide_order_weight").next().down().innerHTML = dhlUnitOfMeasureNote;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@

<a class="action-default"
data-paypal-button="true"
href="<?php
/* @noEscape */ echo $block->escapeUrl($block->getSandboxButtonUrl(). '?' . $block->getQuery());
?>"
href="<?= /* @noEscape */ $block->escapeUrl($block->getSandboxButtonUrl(). '?' . $block->getQuery()) ?>"
target="PPFrame"><?= $block->escapeHtml($block->getSandboxButtonLabel()) ?></a>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
data-max-file-size="<?= /* @escapeNotVerified */ $fileMaxSize ?>"
>
<div class="image image-placeholder">
<input type="file" name="image" data-url="<?php
/* @escapeNotVerified */ echo $uploadUrl;?>" multiple="multiple" />
<input type="file" name="image" data-url="<?= /* @escapeNotVerified */ $uploadUrl ?>" multiple="multiple" />
<img class="spacer" src="<?= /* @escapeNotVerified */ $spacerImage ?>"/>
<p class="image-placeholder-text"><?= /* @escapeNotVerified */ $imagePlaceholderText ?></p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ $sessionInfoCollection = $block->getSessionInfoCollection();
<?php
if ($block->areMultipleSessionsActive()): ?>
data-mage-init='{"confirmRedirect":{
"message": "<?php
echo $block->escapeJs(__('Are you sure that you want to log out all other sessions?'))
"message": "<?=
$block->escapeJs(__('Are you sure that you want to log out all other sessions?'))
?>",
"url":"<?php
echo $block->escapeJs($block->escapeUrl($block->getUrl('security/session/logoutAll')))
"url":"<?=
$block->escapeJs($block->escapeUrl($block->getUrl('security/session/logoutAll')))
?>"
}}'
<?php
Expand All @@ -69,7 +69,6 @@ $sessionInfoCollection = $block->getSessionInfoCollection();
</button>
</div>

<div><?php
echo $block->escapeHtml(__('This computer is using IP address %1.', $block->getRemoteIp())) ?></div>
<div><?= $block->escapeHtml(__('This computer is using IP address %1.', $block->getRemoteIp())) ?></div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function dataProviderGetAllOptionsNameIntegrity()
'value' => ['value' => 5, 'label' => 'comment <!-- comment -->'],
],
[
'value' => ['value' => 6, 'label' => 'php tag <?php echo "2"; ?>'],
'value' => ['value' => 6, 'label' => 'php tag <?= "2"; ?>'],
],

];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function dataProviderGetAllOptionsNameIntegrity()
'value' => ['value' => 5, 'label' => 'comment <!-- comment -->'],
],
[
'value' => ['value' => 6, 'label' => 'php tag <?php echo "2"; ?>'],
'value' => ['value' => 6, 'label' => 'php tag <?= "2"; ?>'],
],

];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* See COPYING.txt for license details.
*/
?>
<?php /* @escapeNotVerified */ echo $block->getMiscellaneousHtml();
<?= /* @escapeNotVerified */ $block->getMiscellaneousHtml();
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
* See COPYING.txt for license details.
*/
/** @var $block \Magento\Framework\View\Element\Template */
echo $block->getChildHtml('', false);
?>
<?= $block->getChildHtml('', false);
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ $ccNumberView = $block->escapeHtml($block->getNumberLast4Digits());
"modalClass": "my-credit-cards-popup",
"toggleEvent": "click",
"title": "<?= $block->escapeHtml(__('Delete')) ?>",
"content": "Are you sure you want to delete this card: <?php
/* @noEscape */ echo $ccNumberView
"content": "Are you sure you want to delete this card: <?=
/* @noEscape */ $ccNumberView
?>?"
}
}'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script type="text/x-magento-init">
{
"body": {
"addToWishlist": <?php /* @noEscape */ echo $this->helper(\Magento\Framework\Json\Helper\Data::class)
"addToWishlist": <?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)
->jsonEncode($block->getWishlistOptions());
?>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
/** @var \Magento\Framework\View\Element\Template $block */
?>

<?php
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']);
<?= $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']);
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
echo 'At the young age of 15, Buffy Summers was chosen to hunt vampires, demons, and the forces of darkness.';
?>
<?= 'At the young age of 15, Buffy Summers was chosen to hunt vampires, demons, and the forces of darkness.';
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
echo 'A man tells his epic life story: love, betrayal, loneliness, and hunger.';
?>
<?= 'A man tells his epic life story: love, betrayal, loneliness, and hunger.';
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
echo 'As a string of mysterious killings grips Seattle, Bella, whose high school graduation is fast approaching,
?>
<?= 'As a string of mysterious killings grips Seattle, Bella, whose high school graduation is fast approaching,
is forced to choose between her love for vampire Edward and her friendship with demon Jacob.';
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
echo 'Vampire Edward leaves Bella after an attack that nearly claimed her life, and in her depression she falls into
?>
<?= 'Vampire Edward leaves Bella after an attack that nearly claimed her life, and in her depression she falls into
yet another paranormal relationship - this time with demon Jacob Black.';

0 comments on commit 48bd391

Please sign in to comment.