Skip to content

Commit

Permalink
Merge pull request #4375 from magento-qwerty/MAGETWO-56445
Browse files Browse the repository at this point in the history
Implemented Stories:
- MAGETWO-56445: Eliminate @escapeNotVerified in Google-related Modules
  • Loading branch information
dvoskoboinikov authored Jun 19, 2019
2 parents ee6bc37 + 08c9032 commit bef5f53
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
22 changes: 10 additions & 12 deletions app/code/Magento/GoogleAdwords/view/frontend/templates/code.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,29 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
?>
<?php
/** @var $block \Magento\GoogleAdwords\Block\Code */
?>
<!-- Google Code for Sale Conversion Page -->
<script>
/* <![CDATA[ */
var google_conversion_id = <?= /* @escapeNotVerified */ $block->getHelper()->getConversionId() ?>;
var google_conversion_language = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionLanguage() ?>";
var google_conversion_format = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionFormat() ?>";
var google_conversion_color = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionColor() ?>";
var google_conversion_label = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionLabel() ?>";
var google_conversion_value = <?= /* @escapeNotVerified */ $block->getHelper()->getConversionValue() ?>;
<?php if($block->getHelper()->hasSendConversionValueCurrency() && $block->getHelper()->getConversionValueCurrency()): ?>
var google_conversion_currency = "<?= /* @escapeNotVerified */ $block->getHelper()->getConversionValueCurrency() ?>";
var google_conversion_id = <?= $block->escapeJs($block->getHelper()->getConversionId()) ?>;
var google_conversion_language = "<?= $block->escapeJs($block->getHelper()->getConversionLanguage()) ?>";
var google_conversion_format = "<?= $block->escapeJs($block->getHelper()->getConversionFormat()) ?>";
var google_conversion_color = "<?= $block->escapeJs($block->getHelper()->getConversionColor()) ?>";
var google_conversion_label = "<?= $block->escapeJs($block->getHelper()->getConversionLabel()) ?>";
var google_conversion_value = <?= $block->escapeJs($block->getHelper()->getConversionValue()) ?>;
<?php if ($block->getHelper()->hasSendConversionValueCurrency() && $block->getHelper()->getConversionValueCurrency()) : ?>
var google_conversion_currency = "<?= $block->escapeJs($block->getHelper()->getConversionValueCurrency()) ?>";
<?php endif; ?>
/* ]]> */
</script>
<script src="<?= /* @escapeNotVerified */ $block->getHelper()->getConversionJsSrc() ?>"></script>
<script src="<?= $block->escapeHtmlAttr($block->getHelper()->getConversionJsSrc()) ?>"></script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt=""
src="<?= /* @escapeNotVerified */ $block->getHelper()->getConversionImgSrc() ?>"/>
src="<?= $block->escapeHtmlAttr($block->getHelper()->getConversionImgSrc()) ?>"/>
</div>
</noscript>
<!-- END Google Code for Sale Conversion Page -->
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

?>
<?php /** @var $block \Magento\GoogleAnalytics\Block\Ga */ ?>
<?php $accountId = $block->getConfig(\Magento\GoogleAnalytics\Helper\Data::XML_PATH_ACCOUNT) ?>
Expand All @@ -16,9 +13,9 @@
"Magento_GoogleAnalytics/js/google-analytics": {
"isCookieRestrictionModeEnabled": <?= (int)$block->isCookieRestrictionModeEnabled() ?>,
"currentWebsite": <?= (int)$block->getCurrentWebsiteId() ?>,
"cookieName": "<?= /* @escapeNotVerified */ \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
"ordersTrackingData": <?= /* @escapeNotVerified */ json_encode($block->getOrdersTrackingData()) ?>,
"pageTrackingData": <?= /* @escapeNotVerified */ json_encode($block->getPageTrackingData($accountId)) ?>
"cookieName": "<?= /* @noEscape */ \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
"ordersTrackingData": <?= /* @noEscape */ json_encode($block->getOrdersTrackingData()) ?>,
"pageTrackingData": <?= /* @noEscape */ json_encode($block->getPageTrackingData($accountId)) ?>
}
}
}
Expand Down

0 comments on commit bef5f53

Please sign in to comment.