Skip to content

Commit 19fab05

Browse files
authored
Merge pull request magento#4263 from magento-borg/borg-2.3
[borg] Fixes
2 parents e3e468c + 175ffc2 commit 19fab05

File tree

151 files changed

+2016
-2280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+2016
-2280
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
}
2828
}
2929
}
30-
</script>
30+
</script>

app/code/Magento/AdvancedSearch/view/adminhtml/templates/system/config/testconnection.phtml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// @codingStandardsIgnoreFile
77
?>
88
<button class="scalable" type="button" id="<?= $block->getHtmlId() ?>" data-mage-init='{"testConnection":{
9-
"url": "<?= /* @escapeNotVerified */ $block->getAjaxUrl() ?>",
9+
"url": "<?= $block->escapeUrl($block->getAjaxUrl()) ?>",
1010
"elementId": "<?= $block->getHtmlId() ?>",
11-
"successText": "<?= /* @escapeNotVerified */ __('Successful! Test again?') ?>",
12-
"failedText": "<?= /* @escapeNotVerified */ __('Connection failed! Test again?') ?>",
13-
"fieldMapping": "<?= /* @escapeNotVerified */ $block->getFieldMapping() ?>"}, "validation": {}}'>
11+
"successText": "<?= $block->escapeHtmlAttr(__('Successful! Test again?')) ?>",
12+
"failedText": "<?= $block->escapeHtmlAttr(__('Connection failed! Test again?')) ?>",
13+
"fieldMapping": "<?= /* @noEscape */ $block->getFieldMapping() ?>"}, "validation": {}}'>
1414
<span><span><span id="<?= $block->getHtmlId() ?>_result"><?= $block->escapeHtml($block->getButtonLabel()) ?></span></span></span>
1515
</button>

app/code/Magento/AdvancedSearch/view/frontend/templates/search_data.phtml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
$data = $block->getItems();
1414
if (count($data)):?>
1515
<dl class="block">
16-
<dt class="title"><?= /* @escapeNotVerified */ __($block->getTitle()) ?></dt>
16+
<dt class="title"><?= $block->escapeHtml(__($block->getTitle())) ?></dt>
1717
<?php foreach ($data as $additionalInfo) : ?>
1818
<dd class="item">
19-
<a href="<?= /* @escapeNotVerified */ $block->getLink($additionalInfo->getQueryText()) ?>"
19+
<a href="<?= $block->escapeUrl($block->getLink($additionalInfo->getQueryText())) ?>"
2020
><?= $block->escapeHtml($additionalInfo->getQueryText()) ?></a>
2121
<?php if ($block->isShowResultsCount()): ?>
22-
<span class="count"><?= /* @escapeNotVerified */ $additionalInfo->getResultsCount() ?></span>
22+
<span class="count"><?= /* @noEscape */ (int)$additionalInfo->getResultsCount() ?></span>
2323
<?php endif; ?>
2424
</dd>
2525
<?php endforeach; ?>

app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml

+12-14
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/** @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Extend */
108
$elementHtml = $block->getParentElementHtml();
119

@@ -20,18 +18,18 @@ $isElementReadonly = $block->getElement()
2018
->getReadonly();
2119
?>
2220

23-
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)): ?>
24-
<div class="<?= /* @escapeNotVerified */ $attributeCode ?> "><?= /* @escapeNotVerified */ $elementHtml ?></div>
21+
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)) : ?>
22+
<div class="<?= $block->escapeHtmlAttr($attributeCode) ?> "><?= /* @noEscape */ $elementHtml ?></div>
2523
<?php endif; ?>
2624

2725
<?= $block->getExtendedElement($switchAttributeCode)->toHtml() ?>
2826

2927
<?php if (!$isElementReadonly && $block->getDisableChild()) { ?>
3028
<script>
3129
require(['prototype'], function () {
32-
function <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change() {
33-
var $attribute = $('<?= /* @escapeNotVerified */ $attributeCode ?>');
34-
if ($('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').value == '<?= /* @escapeNotVerified */ $block::DYNAMIC ?>') {
30+
function <?= /* @noEscape */ $switchAttributeCode ?>_change() {
31+
var $attribute = $('<?= $block->escapeJs($attributeCode) ?>');
32+
if ($('<?= /* @noEscape */ $switchAttributeCode ?>').value == '<?= $block->escapeJs($block::DYNAMIC) ?>') {
3533
if ($attribute) {
3634
$attribute.disabled = true;
3735
$attribute.value = '';
@@ -43,10 +41,10 @@ $isElementReadonly = $block->getElement()
4341
} else {
4442
if ($attribute) {
4543
<?php if ($attributeCode === 'price' && !$block->getCanEditPrice() && $block->getCanReadPrice()
46-
&& $block->getProduct()->isObjectNew()): ?>
47-
<?php $defaultProductPrice = $block->getDefaultProductPrice() ?: "''"; ?>
48-
$attribute.value = <?= /* @escapeNotVerified */ $defaultProductPrice ?>;
49-
<?php else: ?>
44+
&& $block->getProduct()->isObjectNew()) : ?>
45+
<?php $defaultProductPrice = $block->getDefaultProductPrice() ?: "''"; ?>
46+
$attribute.value = <?= /* @noEscape */ (string)$defaultProductPrice ?>;
47+
<?php else : ?>
5048
$attribute.disabled = false;
5149
$attribute.addClassName('required-entry');
5250
<?php endif; ?>
@@ -58,11 +56,11 @@ $isElementReadonly = $block->getElement()
5856
}
5957

6058
<?php if (!($attributeCode === 'price' && !$block->getCanEditPrice()
61-
&& !$block->getProduct()->isObjectNew())): ?>
62-
$('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').observe('change', <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change);
59+
&& !$block->getProduct()->isObjectNew())) : ?>
60+
$('<?= /* @noEscape */ $switchAttributeCode ?>').observe('change', <?= /* @noEscape */ $switchAttributeCode ?>_change);
6361
<?php endif; ?>
6462
Event.observe(window, 'load', function(){
65-
<?= /* @escapeNotVerified */ $switchAttributeCode ?>_change();
63+
<?= /* @noEscape */ $switchAttributeCode ?>_change();
6664
});
6765
});
6866
</script>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/bundle.phtml

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107

118
<?php /* @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Bundle */ ?>
129
<?php $options = $block->decorateArray($block->getOptions(true)); ?>
13-
<?php if (count($options)): ?>
10+
<?php if (count($options)) : ?>
1411
<fieldset id="catalog_product_composite_configure_fields_bundle"
1512
class="fieldset admin__fieldset composite-bundle<?= $block->getIsLastFieldset() ? ' last-fieldset' : '' ?>">
16-
<legend class="legend admin__legend"><span><?= /* @escapeNotVerified */ __('Bundle Items') ?></span></legend><br />
13+
<legend class="legend admin__legend">
14+
<span><?= $block->escapeHtml(__('Bundle Items')) ?></span>
15+
</legend><br />
1716
<?php foreach ($options as $option) : ?>
1817
<?php if ($option->getSelections()) : ?>
1918
<?= $block->getOptionHtml($option) ?>
@@ -71,7 +70,7 @@ require([
7170
}
7271
}
7372
};
74-
ProductConfigure.bundleControl = new BundleControl(<?= /* @escapeNotVerified */ $block->getJsonConfig() ?>);
73+
ProductConfigure.bundleControl = new BundleControl(<?= /* @noEscape */ $block->getJsonConfig() ?>);
7574
});
7675
</script>
7776

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml

+23-25
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,58 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
6+
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
97
?>
108
<?php /* @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Checkbox */ ?>
119
<?php $_option = $block->getOption(); ?>
1210
<?php $_selections = $_option->getSelections(); ?>
13-
<?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?>
11+
<?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?>
1412

15-
<div class="field admin__field options<?php if ($_option->getRequired()) echo ' required _required' ?>">
13+
<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' required _required'; } ?>">
1614
<label class="label admin__field-label">
1715
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
1816
</label>
1917

2018
<div class="control admin__field-control">
21-
<div class="nested <?php if ($_option->getDecoratedIsLast()):?> last<?php endif;?>">
19+
<div class="nested <?php if ($_option->getDecoratedIsLast()) :?> last<?php endif;?>">
2220

23-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
24-
<?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
21+
<?php if (count($_selections) == 1 && $_option->getRequired()) : ?>
22+
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
2523
<input type="hidden"
26-
name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>]"
27-
value="<?= /* @escapeNotVerified */ $_selections[0]->getSelectionId() ?>"
28-
price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selections[0]) ?>" />
29-
<?php else:?>
24+
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
25+
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"
26+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selections[0])) ?>" />
27+
<?php else :?>
3028

31-
<?php foreach ($_selections as $_selection): ?>
29+
<?php foreach ($_selections as $_selection) : ?>
3230
<div class="field choice admin__field admin__field-option">
3331
<input
34-
class="change-container-classname admin__control-checkbox checkbox bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>"
35-
id="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>-<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>"
32+
class="change-container-classname admin__control-checkbox checkbox bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> <?php if ($_option->getRequired()) { echo 'validate-one-required-by-name'; } ?>"
33+
id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
3634
type="checkbox"
37-
name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>][<?= /* @escapeNotVerified */ $_selection->getId() ?>]"
38-
<?php if ($block->isSelected($_selection)):?>
35+
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
36+
<?php if ($block->isSelected($_selection)) :?>
3937
<?= ' checked="checked"' ?>
4038
<?php endif;?>
41-
<?php if (!$_selection->isSaleable() && !$_skipSaleableCheck):?>
39+
<?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) :?>
4240
<?= ' disabled="disabled"' ?>
4341
<?php endif;?>
44-
value="<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>"
42+
value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
4543
onclick="ProductConfigure.bundleControl.changeSelection(this)"
46-
price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selection) ?>" />
44+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selection)) ?>" />
4745

4846
<label class="admin__field-label"
49-
for="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>-<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>">
50-
<span><?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
47+
for="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>">
48+
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
5149
</label>
5250

53-
<?php if ($_option->getRequired()): ?>
54-
<?= /* @escapeNotVerified */ $block->setValidationContainer('bundle-option-' . $_option->getId() . '-' . $_selection->getSelectionId(), 'bundle-option-' . $_option->getId() . '-container') ?>
51+
<?php if ($_option->getRequired()) : ?>
52+
<?= /* @noEscape */ $block->setValidationContainer('bundle-option-' . $_option->getId() . '-' . $_selection->getSelectionId(), 'bundle-option-' . $_option->getId() . '-container') ?>
5553
<?php endif;?>
5654
</div>
5755
<?php endforeach; ?>
5856

59-
<div id="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>-container"></div>
57+
<div id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></div>
6058
<?php endif; ?>
6159
</div>
6260
</div>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml

+20-18
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
6+
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
97
?>
108
<?php /* @var $block \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Options\Type\Multi */ ?>
119
<?php $_option = $block->getOption(); ?>
1210
<?php $_selections = $_option->getSelections(); ?>
13-
<?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?>
14-
<div class="field admin__field <?php if ($_option->getRequired()) echo ' required' ?><?php if ($_option->getDecoratedIsLast()):?> last<?php endif; ?>">
11+
<?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?>
12+
<div class="field admin__field <?php if ($_option->getRequired()) { echo ' required'; } ?><?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?>">
1513
<label class="label admin__field-label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label>
1614
<div class="control admin__field-control">
17-
<?php if (count($_selections) == 1 && $_option->getRequired()): ?>
18-
<?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
19-
<input type="hidden" name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>]"
20-
value="<?= /* @escapeNotVerified */ $_selections[0]->getSelectionId() ?>"
21-
price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selections[0]) ?>" />
22-
<?php else: ?>
23-
<select multiple="multiple" size="5" id="bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?>"
24-
name="bundle_option[<?= /* @escapeNotVerified */ $_option->getId() ?>][]"
25-
class="admin__control-multiselect bundle-option-<?= /* @escapeNotVerified */ $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> multiselect change-container-classname"
15+
<?php if (count($_selections) == 1 && $_option->getRequired()) : ?>
16+
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
17+
<input type="hidden" name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
18+
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"
19+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selections[0])) ?>" />
20+
<?php else : ?>
21+
<select multiple="multiple" size="5" id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>"
22+
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][]"
23+
class="admin__control-multiselect bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?><?php if ($_option->getRequired()) { echo ' required-entry'; } ?> multiselect change-container-classname"
2624
onchange="ProductConfigure.bundleControl.changeSelection(this)">
27-
<?php if(!$_option->getRequired()): ?>
28-
<option value=""><?= /* @escapeNotVerified */ __('None') ?></option>
25+
<?php if (!$_option->getRequired()) : ?>
26+
<option value=""><?= $block->escapeHtml(__('None')) ?></option>
2927
<?php endif; ?>
30-
<?php foreach ($_selections as $_selection): ?>
31-
<option value="<?= /* @escapeNotVerified */ $_selection->getSelectionId() ?>"<?php if ($block->isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?= /* @escapeNotVerified */ $block->getSelectionPrice($_selection) ?>"><?= /* @escapeNotVerified */ $block->getSelectionQtyTitlePrice($_selection, false) ?></option>
28+
<?php foreach ($_selections as $_selection) : ?>
29+
<option value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
30+
<?php if ($block->isSelected($_selection)) { echo ' selected="selected"'; } ?>
31+
<?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) { echo ' disabled="disabled"'; } ?>
32+
price="<?= $block->escapeHtmlAttr($block->getSelectionPrice($_selection)) ?>">
33+
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection, false) ?></option>
3234
<?php endforeach; ?>
3335
</select>
3436
<?php endif; ?>

0 commit comments

Comments
 (0)