Skip to content

Commit 2cc494e

Browse files
Merge branch 'develop' of https://github.com/magento/magento2ce into MAGETWO-56240
2 parents e9a3678 + 95eae4e commit 2cc494e

File tree

154 files changed

+2537
-764
lines changed

Some content is hidden

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

154 files changed

+2537
-764
lines changed

app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public function getBundleOptions(ItemInterface $item)
142142
. $this->pricingHelper->currency(
143143
$this->getSelectionFinalPrice($item, $bundleSelection)
144144
);
145+
$option['has_html'] = true;
145146
}
146147
}
147148

app/code/Magento/Bundle/Test/Unit/Helper/Catalog/Product/ConfigurationTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public function testGetBundleOptionsEmptyBundleSelectionIds()
164164
$this->assertEquals([], $this->helper->getBundleOptions($this->item));
165165
}
166166

167+
/**
168+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
169+
*/
167170
public function testGetOptions()
168171
{
169172
$optionIds = 'a:1:{i:0;i:1;}';
@@ -254,8 +257,12 @@ public function testGetOptions()
254257

255258
$this->assertEquals(
256259
[
257-
0 => ['label' => 'title', 'value' => [0 => '1 x name <span class="price">$15.00</span>']],
258-
1 => ['label' => 'title', 'value' => 'value'],
260+
[
261+
'label' => 'title',
262+
'value' => ['1 x name <span class="price">$15.00</span>'],
263+
'has_html' => true,
264+
],
265+
['label' => 'title', 'value' => 'value'],
259266
],
260267
$this->helper->getOptions($this->item)
261268
);

app/code/Magento/Captcha/view/adminhtml/templates/default.phtml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
id="captcha"
2020
class="admin__control-text"
2121
type="text"
22-
name="<?php /* @escapeNotVerified */ echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php /* @escapeNotVerified */ echo $block->getFormId()?>]"
22+
name="<?php echo $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?php echo $block->escapeHtml($block->getFormId())?>]"
2323
data-validate="{required:true}"/>
2424
<?php if ($captcha->isCaseSensitive()) :?>
2525
<div class="admin__field-note">
@@ -32,19 +32,19 @@
3232
<img
3333
id="captcha-reload"
3434
class="captcha-reload"
35-
src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('Magento_Captcha::reload.png') ?>"
35+
src="<?php echo $block->escapeUrl($block->getViewFileUrl('Magento_Captcha::reload.png')) ?>"
3636
alt="<?php /* @escapeNotVerified */ echo __('Reload captcha') ?>"/>
3737
<img
38-
id="<?php /* @escapeNotVerified */ echo $block->getFormId() ?>"
39-
width="<?php /* @escapeNotVerified */ echo $block->getImgWidth() ?>"
40-
height="<?php /* @escapeNotVerified */ echo $block->getImgHeight() ?>"
41-
src="<?php /* @escapeNotVerified */ echo $captcha->getImgSrc() ?>" />
38+
id="<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"
39+
width="<?php /* @noEscape */ echo (float) $block->getImgWidth() ?>"
40+
height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>"
41+
src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>" />
4242
</div>
4343
<script>
4444
require(["prototype", "mage/captcha"], function(){
4545

4646
//<![CDATA[
47-
var captcha = new Captcha('<?php /* @escapeNotVerified */ echo $block->getRefreshUrl() ?>', '<?php /* @escapeNotVerified */ echo $block->getFormId() ?>');
47+
var captcha = new Captcha('<?php echo $block->escapeUrl($block->getRefreshUrl()) ?>', '<?php echo $block->escapeJs($block->getFormId()) ?>');
4848

4949
$('captcha-reload').observe('click', function () {
5050
captcha.refresh(this);

app/code/Magento/Captcha/view/frontend/templates/default.phtml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
<?php /* @var $captcha \Magento\Captcha\Model\DefaultModel */ ?>
1111
<?php /* @var $block \Magento\Captcha\Block\Captcha\DefaultCaptcha */ ?>
1212
<?php $captcha = $block->getCaptchaModel() ?>
13-
<div class="field captcha required" role="<?php /* @escapeNotVerified */ echo $block->getFormId()?>">
14-
<label for="captcha_<?php /* @escapeNotVerified */ echo $block->getFormId() ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Please type the letters below')?></span></label>
13+
<div class="field captcha required" role="<?php echo $block->escapeHtmlAttr($block->getFormId())?>">
14+
<label for="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Please type the letters below')?></span></label>
1515
<div class="control captcha">
16-
<input name="<?php /* @escapeNotVerified */ echo \Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE ?>[<?php /* @escapeNotVerified */ echo $block->getFormId()?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php /* @escapeNotVerified */ echo $block->getFormId() ?>" />
16+
<input name="<?php echo $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?php echo $block->escapeHtmlAttr($block->getFormId())?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" />
1717
<div class="nested">
1818
<div class="field captcha no-label"
19-
data-captcha="<?php /* @escapeNotVerified */ echo $block->getFormId()?>"
20-
id="captcha-container-<?php /* @escapeNotVerified */ echo $block->getFormId()?>"
21-
data-mage-init='{"captcha":{"url": "<?php /* @escapeNotVerified */ echo $block->getRefreshUrl()?>",
22-
"imageLoader": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/loader-2.gif') ?>",
23-
"type": "<?php /* @escapeNotVerified */ echo $block->getFormId() ?>"}}'>
19+
data-captcha="<?php echo $block->escapeHtmlAttr($block->getFormId())?>"
20+
id="captcha-container-<?php echo $block->escapeHtmlAttr($block->getFormId())?>"
21+
data-mage-init='{"captcha":{"url": "<?php echo $block->escapeUrl($block->getRefreshUrl())?>",
22+
"imageLoader": "<?php echo $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
23+
"type": "<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
2424
<div class="control captcha-image">
25-
<img alt="<?php /* @escapeNotVerified */ echo __('Please type the letters below')?>" class="captcha-img" height="<?php /* @escapeNotVerified */ echo $block->getImgHeight() ?>" src="<?php /* @escapeNotVerified */ echo $captcha->getImgSrc() ?>"/>
25+
<img alt="<?php /* @escapeNotVerified */ echo __('Please type the letters below')?>" class="captcha-img" height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>" src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>"/>
2626
<button type="button" class="action reload captcha-reload" title="<?php /* @escapeNotVerified */ echo __('Reload captcha') ?>"><span><?php /* @escapeNotVerified */ echo __('Reload captcha') ?></span></button>
2727
</div>
2828
</div>

app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function (node, e) {
121121
}
122122
';
123123
} else {
124-
$chooserJsObject = $this->getId();
124+
$chooserJsObject = $this->escapeJs($this->getId());
125125
$js = '
126126
function (node, e) {
127127
' .

app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function (node, e) {
202202
{jsObject}.categoryName = node.attributes.id != "none" ? node.text : false;
203203
}
204204
';
205-
$js = str_replace('{jsObject}', $this->getJsObjectName(), $js);
205+
$js = str_replace('{jsObject}', $this->escapeJs($this->getJsObjectName()), $js);
206206
return $js;
207207
}
208208

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPrice.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,16 @@ public function __construct(
5656
public function build($productId)
5757
{
5858
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
59+
$productTable = $this->resource->getTableName('catalog_product_entity');
5960

6061
return [$this->resource->getConnection()->select()
61-
->from(['parent' => 'catalog_product_entity'], '')
62+
->from(['parent' => $productTable], '')
6263
->joinInner(
6364
['link' => $this->resource->getTableName('catalog_product_relation')],
6465
"link.parent_id = parent.$linkField",
6566
[]
6667
)->joinInner(
67-
['child' => 'catalog_product_entity'],
68+
['child' => $productTable],
6869
"child.entity_id = link.child_id",
6970
['entity_id']
7071
)->joinInner(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ public function build($productId)
6565
{
6666
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
6767
$priceAttribute = $this->eavConfig->getAttribute(Product::ENTITY, 'price');
68+
$productTable = $this->resource->getTableName('catalog_product_entity');
69+
6870
$priceSelect = $this->resource->getConnection()->select()
69-
->from(['parent' => 'catalog_product_entity'], '')
71+
->from(['parent' => $productTable], '')
7072
->joinInner(
7173
['link' => $this->resource->getTableName('catalog_product_relation')],
7274
"link.parent_id = parent.$linkField",
7375
[]
7476
)->joinInner(
75-
['child' => 'catalog_product_entity'],
77+
['child' => $productTable],
7678
"child.entity_id = link.child_id",
7779
['entity_id']
7880
)->joinInner(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,16 @@ public function build($productId)
8686
$specialPriceToDate = $this->eavConfig->getAttribute(Product::ENTITY, 'special_to_date');
8787
$timestamp = $this->localeDate->scopeTimeStamp($this->storeManager->getStore());
8888
$currentDate = $this->dateTime->formatDate($timestamp, false);
89+
$productTable = $this->resource->getTableName('catalog_product_entity');
8990

9091
$specialPrice = $this->resource->getConnection()->select()
91-
->from(['parent' => 'catalog_product_entity'], '')
92+
->from(['parent' => $productTable], '')
9293
->joinInner(
9394
['link' => $this->resource->getTableName('catalog_product_relation')],
9495
"link.parent_id = parent.$linkField",
9596
[]
9697
)->joinInner(
97-
['child' => 'catalog_product_entity'],
98+
['child' => $productTable],
9899
"child.entity_id = link.child_id",
99100
['entity_id']
100101
)->joinInner(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,16 @@ public function __construct(
6868
public function build($productId)
6969
{
7070
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
71+
$productTable = $this->resource->getTableName('catalog_product_entity');
72+
7173
$priceSelect = $this->resource->getConnection()->select()
72-
->from(['parent' => 'catalog_product_entity'], '')
74+
->from(['parent' => $productTable], '')
7375
->joinInner(
7476
['link' => $this->resource->getTableName('catalog_product_relation')],
7577
"link.parent_id = parent.$linkField",
7678
[]
7779
)->joinInner(
78-
['child' => 'catalog_product_entity'],
80+
['child' => $productTable],
7981
"child.entity_id = link.child_id",
8082
['entity_id']
8183
)->joinInner(

0 commit comments

Comments
 (0)