Skip to content

Commit 8fe4030

Browse files
author
Stanislav Idolov
committed
Merge remote-tracking branch 'mainline/develop' into bugs
2 parents 0570335 + ada45cc commit 8fe4030

File tree

181 files changed

+1746
-652
lines changed

Some content is hidden

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

181 files changed

+1746
-652
lines changed

app/code/Magento/CatalogInventory/Setup/UpgradeData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
5555
{
5656
$setup->startSetup();
57-
if (version_compare($context->getVersion(), '2.0.2') < 0) {
57+
if (version_compare($context->getVersion(), '2.2.0') < 0) {
5858
$this->upgradeCatalogInventoryStockItem($setup);
5959
}
6060
$setup->endSetup();

app/code/Magento/CatalogInventory/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_CatalogInventory" setup_version="2.0.2">
9+
<module name="Magento_CatalogInventory" setup_version="2.2.0">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
</sequence>

app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
$mode = 'grid';
1616

1717
$image = 'new_products_content_widget_grid';
18-
$title = $block->getTitle() ? __($block->getTitle()) : '';
1918
$items = $block->getProductCollection()->getItems();
2019

2120
$showWishlist = true;
@@ -25,9 +24,9 @@
2524
$description = false;
2625
?>
2726
<div class="block widget block-products-list <?php /* @noEscape */ echo $mode; ?>">
28-
<?php if ($title): ?>
27+
<?php if ($block->getTitle()): ?>
2928
<div class="block-title">
30-
<strong><?php echo $block->escapeHtml($title); ?></strong>
29+
<strong><?php echo $block->escapeHtml(__($block->getTitle())); ?></strong>
3130
</div>
3231
<?php endif ?>
3332
<div class="block-content">
@@ -64,27 +63,23 @@
6463
<div class="actions-primary">
6564
<?php if ($_item->isSaleable()): ?>
6665
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)): ?>
67-
<button class="action tocart primary"
68-
data-mage-init='{"redirectUrl":{"url":"<?php echo $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}'
69-
type="button" title="<?php /* @escapeNotVerified */ echo __('Add to Cart') ?>">
70-
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
66+
<button class="action tocart primary" data-mage-init='{"redirectUrl":{"url":"<?php echo $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?php echo $block->escapeHtmlAttr(__('Add to Cart')) ?>">
67+
<span><?php echo $block->escapeHtml(__('Add to Cart')) ?></span>
7168
</button>
7269
<?php else: ?>
7370
<?php
7471
$postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
7572
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
7673
?>
77-
<button class="action tocart primary"
78-
data-post='<?php /* @noEscape */ echo $postData; ?>'
79-
type="button" title="<?php /* @escapeNotVerified */ echo __('Add to Cart') ?>">
80-
<span><?php /* @escapeNotVerified */ echo __('Add to Cart') ?></span>
74+
<button class="action tocart primary" data-post='<?php /* @noEscape */ echo $postData; ?>' type="button" title="<?php echo $block->escapeHtmlAttr(__('Add to Cart')) ?>">
75+
<span><?php echo $block->escapeHtml(__('Add to Cart')) ?></span>
8176
</button>
8277
<?php endif; ?>
8378
<?php else: ?>
8479
<?php if ($_item->getIsSalable()): ?>
85-
<div class="stock available"><span><?php /* @escapeNotVerified */ echo __('In stock') ?></span></div>
80+
<div class="stock available"><span><?php echo $block->escapeHtml(__('In stock')) ?></span></div>
8681
<?php else: ?>
87-
<div class="stock unavailable"><span><?php /* @escapeNotVerified */ echo __('Out of stock') ?></span></div>
82+
<div class="stock unavailable"><span><?php echo $block->escapeHtml(__('Out of stock')) ?></span></div>
8883
<?php endif; ?>
8984
<?php endif; ?>
9085
</div>
@@ -93,18 +88,14 @@
9388
<div class="actions-secondary" data-role="add-to-links">
9489
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
9590
<a href="#"
96-
data-post='<?php /* @noEscape */ echo $block->getAddToWishlistParams($_item); ?>'
97-
class="action towishlist" data-action="add-to-wishlist"
98-
title="<?php /* @escapeNotVerified */ echo __('Add to Wish List') ?>">
99-
<span><?php /* @escapeNotVerified */ echo __('Add to Wish List') ?></span>
91+
data-post='<?php /* @noEscape */ echo $block->getAddToWishlistParams($_item); ?>' class="action towishlist" data-action="add-to-wishlist" title="<?php echo $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
92+
<span><?php echo $block->escapeHtml(__('Add to Wish List')) ?></span>
10093
</a>
10194
<?php endif; ?>
10295
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
10396
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
104-
<a href="#" class="action tocompare"
105-
data-post='<?php /* @noEscape */ echo $compareHelper->getPostDataParams($_item);?>'
106-
title="<?php /* @escapeNotVerified */ echo __('Add to Compare') ?>">
107-
<span><?php /* @escapeNotVerified */ echo __('Add to Compare') ?></span>
97+
<a href="#" class="action tocompare" data-post='<?php /* @noEscape */ echo $compareHelper->getPostDataParams($_item);?>' title="<?php echo $block->escapeHtmlAttr(__('Add to Compare')) ?>">
98+
<span><?php echo $block->escapeHtml(__('Add to Compare')) ?></span>
10899
</a>
109100
<?php endif; ?>
110101
</div>

app/code/Magento/Cms/view/adminhtml/templates/browser/content/files.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ $_height = $block->getImagesHeight();
2121
<?php endif; ?>
2222
</p>
2323
<?php if ($block->getFileWidth($file)): ?>
24-
<small><?php echo $block->escapeHtml($block->getFileWidth($file)) ?>x<?php echo $block->escapeHtml($block->getFileHeight($file)) ?> <?php /* @escapeNotVerified */ echo __('px.') ?></small><br/>
24+
<small><?php echo $block->escapeHtml($block->getFileWidth($file)) ?>x<?php echo $block->escapeHtml($block->getFileHeight($file)) ?> <?php echo $block->escapeHtml(__('px.')) ?></small><br/>
2525
<?php endif; ?>
2626
<small><?php echo $block->escapeHtml($block->getFileShortName($file)); ?></small>
2727
</div>
2828
<?php endforeach; ?>
2929
<?php else: ?>
30-
<div class="empty"><?php /* @escapeNotVerified */ echo __('No files found') ?></div>
30+
<div class="empty"><?php echo $block->escapeHtml(__('No files found')) ?></div>
3131
<?php endif; ?>

app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<div id="<?php echo $block->getHtmlId() ?>" class="uploader">
1313
<span class="fileinput-button form-buttons">
14-
<span><?php /* @escapeNotVerified */ echo __('Browse Files...') ?></span>
14+
<span><?php echo $block->escapeHtml(__('Browse Files...')) ?></span>
1515
<input class="fileupload" type="file" name="<?php echo $block->escapeHtmlAttr($block->getConfig()->getFileField()) ?>" data-url="<?php echo $block->escapeUrl($block->getConfig()->getUrl()) ?>" multiple>
1616
</span>
1717
<div class="clear"></div>

app/code/Magento/Cms/view/adminhtml/templates/browser/tree.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<div class="tree-panel" >
1212
<div class="categories-side-col">
1313
<div class="tree-actions">
14-
<a onclick="jQuery('[data-role=tree]').jstree('close_all');"><?php /* @escapeNotVerified */ echo __('Collapse All'); ?></a>
14+
<a onclick="jQuery('[data-role=tree]').jstree('close_all');"><?php echo $block->escapeHtml(__('Collapse All')) ?></a>
1515
<span class="separator">|</span>
16-
<a onclick="jQuery('[data-role=tree]').jstree('open_all');"><?php /* @escapeNotVerified */ echo __('Expand All'); ?></a>
16+
<a onclick="jQuery('[data-role=tree]').jstree('open_all');"><?php echo $block->escapeHtml(__('Expand All')) ?></a>
1717
</div>
1818
</div>
1919
<div data-role="tree" data-mage-init='<?php echo $block->escapeHtml($this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getTreeWidgetOptions())); ?>'>

app/code/Magento/Cms/view/frontend/templates/widget/link/link_block.phtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
/**
8+
* @var \Magento\Cms\Block\Widget\Page\Link $block
9+
*/
610
?>
711
<div class="widget block block-cms-link">
8-
<a <?php /* @escapeNotVerified */ echo $block->getLinkAttributes() ?>>
12+
<a <?php /* @noEscape */ echo $block->getLinkAttributes() ?>>
913
<span><?php echo $block->escapeHtml($block->getLabel()) ?></span>
1014
</a>
1115
</div>

app/code/Magento/Cms/view/frontend/templates/widget/link/link_inline.phtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
/**
8+
* @var \Magento\Cms\Block\Widget\Page\Link $block
9+
*/
610
?>
711
<span class="widget block block-cms-link-inline">
8-
<a <?php /* @escapeNotVerified */ echo $block->getLinkAttributes() ?>>
12+
<a <?php /* @noEscape */ echo $block->getLinkAttributes() ?>>
913
<span><?php echo $block->escapeHtml($block->getLabel()) ?></span>
1014
</a>
1115
</span>

app/code/Magento/Integration/Model/Config.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Integration\Model;
77

8+
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Serialize\SerializerInterface;
810
use Magento\Integration\Model\Cache\Type;
911

1012
/**
@@ -34,14 +36,24 @@ class Config
3436
*/
3537
protected $_integrations;
3638

39+
/**
40+
* @var SerializerInterface
41+
*/
42+
private $serializer;
43+
3744
/**
3845
* @param Cache\Type $configCacheType
3946
* @param Config\Reader $configReader
47+
* @param SerializerInterface $serializer
4048
*/
41-
public function __construct(Cache\Type $configCacheType, Config\Reader $configReader)
42-
{
49+
public function __construct(
50+
Cache\Type $configCacheType,
51+
Config\Reader $configReader,
52+
SerializerInterface $serializer = null
53+
) {
4354
$this->_configCacheType = $configCacheType;
4455
$this->_configReader = $configReader;
56+
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
4557
}
4658

4759
/**
@@ -55,10 +67,14 @@ public function getIntegrations()
5567
if (null === $this->_integrations) {
5668
$integrations = $this->_configCacheType->load(self::CACHE_ID);
5769
if ($integrations && is_string($integrations)) {
58-
$this->_integrations = unserialize($integrations);
70+
$this->_integrations = $this->serializer->unserialize($integrations);
5971
} else {
6072
$this->_integrations = $this->_configReader->read();
61-
$this->_configCacheType->save(serialize($this->_integrations), self::CACHE_ID, [Type::CACHE_TAG]);
73+
$this->_configCacheType->save(
74+
$this->serializer->serialize($this->_integrations),
75+
self::CACHE_ID,
76+
[Type::CACHE_TAG]
77+
);
6278
}
6379
}
6480
return $this->_integrations;

app/code/Magento/Integration/Model/ConsolidatedConfig.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Integration\Model;
77

8+
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Serialize\SerializerInterface;
810
use Magento\Integration\Model\Cache\TypeConsolidated;
911

1012
/**
@@ -31,14 +33,24 @@ class ConsolidatedConfig
3133
*/
3234
protected $integrations;
3335

36+
/**
37+
* @var SerializerInterface
38+
*/
39+
private $serializer;
40+
3441
/**
3542
* @param Cache\TypeConsolidated $configCacheType
3643
* @param Config\Consolidated\Reader $configReader
44+
* @param SerializerInterface $serializer
3745
*/
38-
public function __construct(Cache\TypeConsolidated $configCacheType, Config\Consolidated\Reader $configReader)
39-
{
46+
public function __construct(
47+
Cache\TypeConsolidated $configCacheType,
48+
Config\Consolidated\Reader $configReader,
49+
SerializerInterface $serializer = null
50+
) {
4051
$this->configCacheType = $configCacheType;
4152
$this->configReader = $configReader;
53+
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
4254
}
4355

4456
/**
@@ -51,11 +63,11 @@ public function getIntegrations()
5163
if (null === $this->integrations) {
5264
$integrations = $this->configCacheType->load(self::CACHE_ID);
5365
if ($integrations && is_string($integrations)) {
54-
$this->integrations = unserialize($integrations);
66+
$this->integrations = $this->serializer->unserialize($integrations);
5567
} else {
5668
$this->integrations = $this->configReader->read();
5769
$this->configCacheType->save(
58-
serialize($this->integrations),
70+
$this->serializer->serialize($this->integrations),
5971
self::CACHE_ID,
6072
[TypeConsolidated::CACHE_TAG]
6173
);

0 commit comments

Comments
 (0)