From c0d2554c8d86c243aae9fc41f51ff43308cede77 Mon Sep 17 00:00:00 2001
From: Igor Melnikov <imelnikov@ebay.com>
Date: Tue, 12 Jul 2016 19:13:09 -0500
Subject: [PATCH] MAGETWO-54652: Replace usages of deprecated escaper functions

Replacing usages of escapeJsQuote and escapeQuote
---
 .../view/adminhtml/templates/backup/dialogs.phtml      |  4 ++--
 .../templates/catalog/product/attribute/set/main.phtml |  8 ++++----
 .../product/composite/fieldset/options/type/date.phtml |  4 ++--
 .../templates/catalog/product/edit/price/tier.phtml    |  4 ++--
 .../templates/catalog/product/attribute/set/js.phtml   |  6 +++---
 .../Customer/view/adminhtml/templates/tab/cart.phtml   |  4 ++--
 .../Block/Adminhtml/System/Config/Field/Country.php    |  4 ++--
 .../SendFriend/view/frontend/templates/send.phtml      |  4 ++--
 .../adminhtml/templates/instance/edit/layout.phtml     | 10 +++++-----
 9 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml b/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml
index a72e646bcea..c3ac897edd8 100644
--- a/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml
+++ b/app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml
@@ -147,8 +147,8 @@ require([
 
 //<![CDATA[
     backup = new AdminBackup();
-    backup.rollbackUrl = '<?php /* @escapeNotVerified */ echo $block->escapeJs($rollbackUrl);?>';
-    backup.backupUrl = '<?php /* @escapeNotVerified */ echo $block->escapeJs($backupUrl);?>';
+    backup.rollbackUrl = '<?php echo $block->escapeUrl($rollbackUrl); ?>';
+    backup.backupUrl = '<?php echo $block->escapeUrl($backupUrl); ?>';
 //]]>
 
 });
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
index 2067b783e02..4379fa062a1 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml
@@ -214,7 +214,7 @@
 
                             if( editSet.SystemNodesExists(editSet.currentNode) ) {
                                 alert({
-                                    content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('This group contains system attributes. Please move system attributes to another group and try again.')) ?>'
+                                    content: '<?php echo $block->escapeJs(__('This group contains system attributes. Please move system attributes to another group and try again.')) ?>'
                                 });
                                 return;
                             }
@@ -343,7 +343,7 @@
 
                         failure : function(o) {
                             alert({
-                                content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('Sorry, we\'re unable to complete this request.')) ?>'
+                                content: '<?php echo $block->escapeJs(__('Sorry, we\'re unable to complete this request.')) ?>'
                             });
                         },
 
@@ -360,7 +360,7 @@
                         rightBeforeAppend : function(tree, nodeThis, node, newParent) {
                             if (node.attributes.is_user_defined == 0) {
                                 alert({
-                                    content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('You can\'t remove attributes from this attribute set.')) ?>'
+                                    content: '<?php echo $block->escapeJs(__('You can\'t remove attributes from this attribute set.')) ?>'
                                 });
                                 return false;
                             } else {
@@ -376,7 +376,7 @@
 
                             if (node.attributes.is_unassignable == 0) {
                                 alert({
-                                    content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('You can\'t remove attributes from this attribute set.')) ?>'
+                                    content: '<?php echo $block->escapeJs(__('You can\'t remove attributes from this attribute set.')) ?>'
                                 });
                                 return false;
                             } else {
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
index 52e49a744de..8eb1e7251d2 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
@@ -58,7 +58,7 @@ require([
                 if (dateTimeParts[i].value == "") return false;
             }
             return true;
-        }, '<?php /* @escapeNotVerified */ echo $block->escapeJs( __('This is a required option.') )?>');
+        }, '<?php echo $block->escapeJs( __('This is a required option.') )?>');
 <?php else: ?>
         jQuery.validator.addMethod('validate-datetime-<?php /* @escapeNotVerified */ echo $_optionId ?>', function(v) {
             var dateTimeParts = jQuery('.datetime-picker[id^="options_<?php /* @escapeNotVerified */ echo $_optionId ?>"]');
@@ -74,7 +74,7 @@ require([
                 }
             }
             return hasWithValue ^ hasWithNoValue;
-        }, '<?php /* @escapeNotVerified */ echo $block->escapeJs( __('The field isn\'t complete.') )?>');
+        }, '<?php echo $block->escapeJs( __('The field isn\'t complete.') )?>');
 <?php endif; ?>
     //]]>
     
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml
index f7ae41f85ef..265ba1ad68f 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/price/tier.phtml
@@ -58,12 +58,12 @@ var tierPriceRowTemplate = '<tr>'
     + '<td class="col-websites"<?php if (!$_showWebsite): ?> style="display:none"<?php endif; ?>>'
     + '<select class="<?php /* @escapeNotVerified */ echo $_htmlClass ?> required-entry" name="<?php /* @escapeNotVerified */ echo $_htmlName ?>[<%- data.index %>][website_id]" id="tier_price_row_<%- data.index %>_website">'
     <?php foreach ($block->getWebsites() as $_websiteId => $_info): ?>
-    + '<option value="<?php /* @escapeNotVerified */ echo $_websiteId ?>"><?php /* @escapeNotVerified */ echo $block->escapeJs($_info['name']) ?><?php if (!empty($_info['currency'])): ?> [<?php echo $block->escapeHtml($_info['currency']) ?>]<?php endif; ?></option>'
+    + '<option value="<?php /* @escapeNotVerified */ echo $_websiteId ?>"><?php echo $block->escapeJs($_info['name']) ?><?php if (!empty($_info['currency'])): ?> [<?php echo $block->escapeHtml($_info['currency']) ?>]<?php endif; ?></option>'
     <?php endforeach ?>
     + '</select></td>'
     + '<td class="col-customer-group"><select class="<?php /* @escapeNotVerified */ echo $_htmlClass ?> custgroup required-entry" name="<?php /* @escapeNotVerified */ echo $_htmlName ?>[<%- data.index %>][cust_group]" id="tier_price_row_<%- data.index %>_cust_group">'
     <?php foreach ($block->getCustomerGroups() as $_groupId => $_groupName): ?>
-    + '<option value="<?php /* @escapeNotVerified */ echo $_groupId ?>"><?php /* @escapeNotVerified */ echo $block->escapeJs($_groupName) ?></option>'
+    + '<option value="<?php /* @escapeNotVerified */ echo $_groupId ?>"><?php echo $block->escapeJs($_groupName) ?></option>'
     <?php endforeach ?>
     + '</select></td>'
     + '<td class="col-qty">'
diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml
index 07641402238..ff4d27dc685 100644
--- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml
+++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml
@@ -29,7 +29,7 @@ editSet.submit = editSet.submit.wrap(function(original) {
     if (editSet.currentNode){
         if (ConfigurableNodeExists(editSet.currentNode)) {
             alert({
-                content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('This group contains attributes used in configurable products. Please move these attributes to another group and try again.')) ?>'
+                content: '<?php echo $block->escapeJs(__('This group contains attributes used in configurable products. Please move these attributes to another group and try again.')) ?>'
             });
             return;
         }
@@ -40,7 +40,7 @@ editSet.submit = editSet.submit.wrap(function(original) {
 editSet.rightBeforeAppend = editSet.rightBeforeAppend.wrap(function(original, tree, nodeThis, node, newParent) {
     if (node.attributes.is_configurable == 1) {
         alert({
-            content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>'
+            content: '<?php echo $block->escapeJs(__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>'
         });
         return false;
     }
@@ -50,7 +50,7 @@ editSet.rightBeforeAppend = editSet.rightBeforeAppend.wrap(function(original, tr
 editSet.rightBeforeInsert = editSet.rightBeforeInsert.wrap(function(original, tree, nodeThis, node, newParent) {
     if (node.attributes.is_configurable == 1) {
         alert({
-            content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>'
+            content: '<?php echo $block->escapeJs(__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>'
         });
         return false;
     }
diff --git a/app/code/Magento/Customer/view/adminhtml/templates/tab/cart.phtml b/app/code/Magento/Customer/view/adminhtml/templates/tab/cart.phtml
index 6b0c05f1d60..af042211d41 100644
--- a/app/code/Magento/Customer/view/adminhtml/templates/tab/cart.phtml
+++ b/app/code/Magento/Customer/view/adminhtml/templates/tab/cart.phtml
@@ -57,14 +57,14 @@ require([
 
         if (!itemId) {
             alert({
-                content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('No item specified.')) ?>'
+                content: '<?php echo $block->escapeJs(__('No item specified.')) ?>'
             });
 
             return false;
         }
 
         confirm({
-            content: '<?php /* @escapeNotVerified */ echo $block->escapeJs(__('Are you sure you want to remove this item?')) ?>',
+            content: '<?php echo $block->escapeJs(__('Are you sure you want to remove this item?')) ?>',
             actions: {
                 confirm: function(){
                     self.reload({'delete':itemId});
diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php
index 9dc304724df..c577cbff06e 100644
--- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php
+++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Field/Country.php
@@ -110,7 +110,7 @@ class Country extends \Magento\Config\Block\System\Config\Form\Field
             'store' => $this->getRequest()->getParam('store'),
             StructurePlugin::REQUEST_PARAM_COUNTRY => '__country__',
         ];
-        $urlString = $this->_escaper->escapeJs($this->_url->getUrl('*/*/*', $urlParams));
+        $urlString = $this->_escaper->escapeUrl($this->_url->getUrl('*/*/*', $urlParams));
         $jsString = '
             $("' . $element->getHtmlId() . '").observe("change", function () {
                 location.href = \'' . $urlString . '\'.replace("__country__", this.value);
@@ -119,7 +119,7 @@ class Country extends \Magento\Config\Block\System\Config\Form\Field
 
         if ($this->_defaultCountry) {
             $urlParams[self::REQUEST_PARAM_DEFAULT_COUNTRY] = '__default__';
-            $urlString = $this->_escaper->escapeJs($this->_url->getUrl('*/*/*', $urlParams));
+            $urlString = $this->_escaper->escapeUrl($this->_url->getUrl('*/*/*', $urlParams));
             $jsParentCountry = $this->_escaper->escapeJs($this->_defaultCountry);
             $jsString .= '
                 $("' . $element->getHtmlId() . '_inherit").observe("click", function () {
diff --git a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml
index c0696ceb000..a2999fe95d0 100644
--- a/app/code/Magento/SendFriend/view/frontend/templates/send.phtml
+++ b/app/code/Magento/SendFriend/view/frontend/templates/send.phtml
@@ -16,8 +16,8 @@
     <div class="actions-toolbar">
         <div class="secondary">
             <button type="button" id="btn-remove<%- data._index_ %>" class="action remove"
-               title="<?php /* @escapeNotVerified */ echo $block->escapeHtmlAttr(__('Remove Recipent')) ?>">
-               <span><?php /* @escapeNotVerified */ echo $block->escapeHtml(__('Remove')) ?></span>
+               title="<?php echo $block->escapeHtmlAttr(__('Remove Recipent')) ?>">
+               <span><?php echo $block->escapeHtml(__('Remove')) ?></span>
             </button>
         </div>
     </div>
diff --git a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml
index b40a0058f3f..418e3975d2a 100644
--- a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml
+++ b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml
@@ -45,18 +45,18 @@ var pageGroupTemplate = '<div class="fieldset-wrapper page_group_container" id="
             '<col width="200" />'+
             '<thead>'+
                 '<tr>'+
-                    '<th><label><?php /* @escapeNotVerified */ echo $block->escapeJs(__('%1', $container['label'])) ?></label></th>'+
-                    '<th><label><?php /* @escapeNotVerified */ echo $block->escapeJs(__('Container')) ?> <span class="required">*</span></label></th>'+
-                    '<th><label><?php /* @escapeNotVerified */ echo $block->escapeJs(__('Template')) ?></label></th>'+
+                    '<th><label><?php echo $block->escapeJs(__('%1', $container['label'])) ?></label></th>'+
+                    '<th><label><?php echo $block->escapeJs(__('Container')) ?> <span class="required">*</span></label></th>'+
+                    '<th><label><?php echo $block->escapeJs(__('Template')) ?></label></th>'+
                 '</tr>'+
             '</thead>'+
             '<tbody>'+
                 '<tr>'+
                     '<td>'+
                         '<input disabled="disabled" type="radio" class="radio for_all" id="all_<?php /* @escapeNotVerified */ echo $container['name'] ?>_<%- data.id %>" name="widget_instance[<%- data.id %>][<?php /* @escapeNotVerified */ echo $container['name'] ?>][for]" value="all" onclick="WidgetInstance.togglePageGroupChooser(this)" checked="checked" />&nbsp;'+
-                        '<label for="all_<?php /* @escapeNotVerified */ echo $container['name'] ?>_<%- data.id %>"><?php /* @escapeNotVerified */ echo $block->escapeJs(__('All')) ?></label><br />'+
+                        '<label for="all_<?php /* @escapeNotVerified */ echo $container['name'] ?>_<%- data.id %>"><?php echo $block->escapeJs(__('All')) ?></label><br />'+
                         '<input disabled="disabled" type="radio" class="radio for_specific" id="specific_<?php /* @escapeNotVerified */ echo $container['name'] ?>_<%- data.id %>" name="widget_instance[<%- data.id %>][<?php /* @escapeNotVerified */ echo $container['name'] ?>][for]" value="specific" onclick="WidgetInstance.togglePageGroupChooser(this)" />&nbsp;'+
-                        '<label for="specific_<?php /* @escapeNotVerified */ echo $container['name'] ?>_<%- data.id %>"><?php /* @escapeNotVerified */ echo $block->escapeJs(__('Specific %1', $container['label'])) ?></label>'+
+                        '<label for="specific_<?php /* @escapeNotVerified */ echo $container['name'] ?>_<%- data.id %>"><?php echo $block->escapeJs(__('Specific %1', $container['label'])) ?></label>'+
                     '</td>'+
                     '<td>'+
                         '<div class="block_reference_container">'+
-- 
GitLab