Skip to content

Commit ca08bc0

Browse files
author
OlgaVasyltsun
committed
Merge remote-tracking branch 'origin/MC-17383' into 2.2-develop-pr104
2 parents 70327fb + 5f4c04d commit ca08bc0

File tree

310 files changed

+2527
-942
lines changed

Some content is hidden

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

310 files changed

+2527
-942
lines changed

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class Feed extends \Magento\Framework\Model\AbstractModel
2525

2626
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2727

28+
/**
29+
* @var \Magento\Framework\Escaper
30+
*/
31+
private $escaper;
32+
2833
/**
2934
* Feed url
3035
*
@@ -77,6 +82,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
7782
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
7883
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
7984
* @param array $data
85+
* @param \Magento\Framework\Escaper|null $escaper
8086
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8187
*/
8288
public function __construct(
@@ -90,7 +96,8 @@ public function __construct(
9096
\Magento\Framework\UrlInterface $urlBuilder,
9197
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
9298
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
93-
array $data = []
99+
array $data = [],
100+
\Magento\Framework\Escaper $escaper = null
94101
) {
95102
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
96103
$this->_backendConfig = $backendConfig;
@@ -99,12 +106,16 @@ public function __construct(
99106
$this->_deploymentConfig = $deploymentConfig;
100107
$this->productMetadata = $productMetadata;
101108
$this->urlBuilder = $urlBuilder;
109+
$this->escaper = $escaper ?? \Magento\Framework\App\ObjectManager::getInstance()->get(
110+
\Magento\Framework\Escaper::class
111+
);
102112
}
103113

104114
/**
105115
* Init model
106116
*
107117
* @return void
118+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
108119
*/
109120
protected function _construct()
110121
{
@@ -255,6 +266,6 @@ public function getFeedXml()
255266
*/
256267
private function escapeString(\SimpleXMLElement $data)
257268
{
258-
return htmlspecialchars((string)$data);
269+
return $this->escaper->escapeHtml((string)$data);
259270
}
260271
}

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-admin-notification",
33
"description": "N/A",
44
"require": {
5-
"php": "~7.0.13|~7.1.0",
5+
"php": "~7.0.13|~7.1.0|~7.2.0",
66
"magento/module-store": "100.2.*",
77
"magento/module-backend": "100.2.*",
88
"magento/module-media-storage": "100.2.*",

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-advanced-pricing-import-export",
33
"description": "N/A",
44
"require": {
5-
"php": "~7.0.13|~7.1.0",
5+
"php": "~7.0.13|~7.1.0|~7.2.0",
66
"magento/module-catalog": "102.0.*",
77
"magento/module-catalog-inventory": "100.2.*",
88
"magento/module-eav": "101.0.*",

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ protected function setUp()
4040
->setMethods(['getComment', 'getHtmlId', 'getName'])
4141
->disableOriginalConstructor()
4242
->getMock();
43+
44+
$objectManager = new ObjectManager($this);
45+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
46+
$objectManager->setBackwardCompatibleProperty(
47+
$this->abstractElementMock,
48+
'_escaper',
49+
$escaper
50+
);
51+
4352
$this->contextMock = $this->getMockBuilder(Context::class)
4453
->setMethods(['getLocaleDate'])
4554
->disableOriginalConstructor()

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/SubscriptionStatusLabelTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ protected function setUp()
5454
->setMethods(['getComment', 'getHtmlId', 'getName'])
5555
->disableOriginalConstructor()
5656
->getMock();
57+
58+
$objectManager = new ObjectManager($this);
59+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
60+
$objectManager->setBackwardCompatibleProperty(
61+
$this->abstractElementMock,
62+
'_escaper',
63+
$escaper
64+
);
65+
5766
$this->formMock = $this->getMockBuilder(Form::class)
5867
->disableOriginalConstructor()
5968
->getMock();

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/VerticalTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ protected function setUp()
3939
->setMethods(['getComment', 'getLabel', 'getHint', 'getHtmlId', 'getName'])
4040
->disableOriginalConstructor()
4141
->getMock();
42+
43+
$objectManager = new ObjectManager($this);
44+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
45+
$objectManager->setBackwardCompatibleProperty(
46+
$this->abstractElementMock,
47+
'_escaper',
48+
$escaper
49+
);
50+
4251
$this->contextMock = $this->getMockBuilder(Context::class)
4352
->disableOriginalConstructor()
4453
->getMock();

app/code/Magento/Analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-analytics",
33
"description": "N/A",
44
"require": {
5-
"php": "~7.0.13|~7.1.0",
5+
"php": "~7.0.13|~7.1.0|~7.2.0",
66
"magento/module-backend": "100.2.*",
77
"magento/module-config": "101.0.*",
88
"magento/module-integration": "100.2.*",

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-authorization",
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
5-
"php": "~7.0.13|~7.1.0",
5+
"php": "~7.0.13|~7.1.0|~7.2.0",
66
"magento/module-backend": "100.2.*",
77
"magento/framework": "101.0.*"
88
},

app/code/Magento/Authorizenet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-authorizenet",
33
"description": "N/A",
44
"require": {
5-
"php": "~7.0.13|~7.1.0",
5+
"php": "~7.0.13|~7.1.0|~7.2.0",
66
"magento/module-sales": "101.0.*",
77
"magento/module-store": "100.2.*",
88
"magento/module-quote": "101.0.*",

app/code/Magento/Backend/Block/Menu.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,15 @@ protected function _getAnchorLabel($menuItem)
143143

144144
/**
145145
* Render menu item mouse events
146+
*
146147
* @param \Magento\Backend\Model\Menu\Item $menuItem
147148
* @return string
148149
*/
149150
protected function _renderMouseEvent($menuItem)
150151
{
151-
return $menuItem->hasChildren() ? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"' : '';
152+
return $menuItem->hasChildren()
153+
? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"'
154+
: '';
152155
}
153156

154157
/**
@@ -216,7 +219,7 @@ protected function _callbackSecretKey($match)
216219
{
217220
$routeId = $this->routeConfig->getRouteByFrontName($match[1]);
218221
return \Magento\Backend\Model\UrlInterface::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey(
219-
$routeId,
222+
$routeId ?: $match[1],
220223
$match[2],
221224
$match[3]
222225
);
@@ -399,7 +402,11 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
399402
$itemName = substr($menuId, strrpos($menuId, '::') + 2);
400403
$itemClass = str_replace('_', '-', strtolower($itemName));
401404

402-
if (count($colBrakes) && $colBrakes[$itemPosition]['colbrake'] && $itemPosition != 1) {
405+
if (is_array($colBrakes)
406+
&& count($colBrakes)
407+
&& $colBrakes[$itemPosition]['colbrake']
408+
&& $itemPosition != 1
409+
) {
403410
$output .= '</ul></li><li class="column"><ul role="menu">';
404411
}
405412

@@ -413,7 +420,7 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
413420
$itemPosition++;
414421
}
415422

416-
if (count($colBrakes) && $limit) {
423+
if (is_array($colBrakes) && count($colBrakes) && $limit) {
417424
$output = '<li class="column"><ul role="menu">' . $output . '</ul></li>';
418425
}
419426

0 commit comments

Comments
 (0)