Skip to content

Commit d05b564

Browse files
author
Gabriel da Gama
authored
Merge branch '2.4-develop' into add-aria-links
2 parents 345758e + e585f82 commit d05b564

File tree

1,398 files changed

+31581
-119859
lines changed

Some content is hidden

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

1,398 files changed

+31581
-119859
lines changed

app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<policy id="script-src">
1212
<values>
1313
<value id="adobedtm" type="host">assets.adobedtm.com</value>
14+
<value id="adobe" type="host">*.adobe.com</value>
15+
</values>
16+
</policy>
17+
<policy id="style-src">
18+
<values>
19+
<value id="adobe" type="host">*.adobe.com</value>
1420
</values>
1521
</policy>
1622
<policy id="img-src">
@@ -19,6 +25,7 @@
1925
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
2026
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
2127
<value id="everesttech" type="host">cm.everesttech.net</value>
28+
<value id="adobe" type="host">*.adobe.com</value>
2229
</values>
2330
</policy>
2431
<policy id="connect-src">
@@ -27,9 +34,15 @@
2734
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
2835
</values>
2936
</policy>
37+
<policy id="media-src">
38+
<values>
39+
<value id="adobe" type="host">*.adobe.com</value>
40+
</values>
41+
</policy>
3042
<policy id="frame-src">
3143
<values>
3244
<value id="amcdemdex" type="host">fast.amc.demdex.net</value>
45+
<value id="adobe" type="host">*.adobe.com</value>
3346
</values>
3447
</policy>
3548
</policies>

app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ define([
3636
return record[this.messageIndex];
3737
},
3838

39+
/**
40+
* Proxy to getLabel function with UnsanitizedHtml suffix
41+
*
42+
* @param {Object} record
43+
* @returns {String}
44+
*/
45+
getLabelUnsanitizedHtml: function (record) {
46+
return this.getLabel(record);
47+
},
48+
3949
/** @inheritdoc */
4050
getFieldClass: function ($row) {
4151
var status = this.statusMap[$row.status] || 'warning',

app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/cells/message.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
*/
66
-->
77
<div css="$col.getFieldClass($row())"
8-
html="$col.getLabel($row())"/>
8+
html="$col.getLabelUnsanitizedHtml($row())"></div>

app/code/Magento/AdvancedPricingImportExport/Controller/Adminhtml/Export/GetFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function execute()
3434
/** @var $export \Magento\ImportExport\Model\Export */
3535
$export = $this->_objectManager->create(\Magento\ImportExport\Model\Export::class);
3636
$export->setData($data);
37-
$attrFilterBlock->prepareCollection(
38-
$export->filterAttributeCollection($export->getEntityAttributeCollection())
37+
$export->filterAttributeCollection(
38+
$attrFilterBlock->prepareCollection($export->getEntityAttributeCollection())
3939
);
4040
return $resultLayout;
4141
} catch (\Exception $e) {

app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingButtonTest.xml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AdminAdvancedReportingButtonTest">
1111
<annotations>
12-
<stories value="AdvancedReporting"/>
13-
<title value="AdvancedReportingButtonTest"/>
14-
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
15-
<testCaseId value="MC-14800"/>
16-
<skip>
17-
<issueId value="MC-14800" />
18-
</skip>
12+
<features value="Analytics"/>
13+
<stories value="Advanced Reporting"/>
14+
<title value="Assert the Advanced Reporting page is opened by dashboard link"/>
15+
<description value="Check the ability to navigate to the Advanced Reporting page through the Advanced Reporting button on the dashboard"/>
1916
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-28376"/>
2018
<group value="analytics"/>
2119
<group value="mtf_migrated"/>
2220
</annotations>

app/code/Magento/AsynchronousOperations/Model/AccessValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public function isAllowed($bulkUuid)
5555
$this->bulkSummaryFactory->create(),
5656
$bulkUuid
5757
);
58-
return $bulkSummary->getUserId() === $this->userContext->getUserId();
58+
return ((int) $bulkSummary->getUserId()) === ((int) $this->userContext->getUserId());
5959
}
6060
}

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
-->
77
<div css="$data.additionalClasses"
88
if="error"
9-
text="error"/>
9+
text="error"></div>

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/cells/actions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
attr="{
1212
title: $action().label
1313
}"
14-
/>
14+
></button>
1515
</div>

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
<a class="action__message-log"
3232
href="#"
3333
click="dismissAll"
34-
text="dismissAllText"/>
34+
text="dismissAllText"></a>
3535
<a class="action__message-log"
3636
attr="{
3737
href: link
3838
}"
39-
text="linkText"/>
39+
text="linkText"></a>
4040
</div>
4141
</div>
4242
</div>

app/code/Magento/Authorization/Model/CompositeUserContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function add(UserContextInterface $userContext)
6060
*/
6161
public function getUserId()
6262
{
63-
return $this->getUserContext() ? $this->getUserContext()->getUserId() : null;
63+
return $this->getUserContext() ? ((int) $this->getUserContext()->getUserId()) : null;
6464
}
6565

6666
/**

app/code/Magento/Backend/App/Action/Plugin/Authentication.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ protected function _redirectIfNeededAfterLogin(\Magento\Framework\App\RequestInt
225225

226226
// Checks, whether secret key is required for admin access or request uri is explicitly set
227227
if ($this->_url->useSecretKey()) {
228-
$requestParts = explode('/', trim($request->getRequestUri(), '/'), 2);
229-
$requestUri = $this->_url->getUrl(array_pop($requestParts));
228+
$requestParts = explode('/', trim($request->getRequestUri(), '/'), 3);
229+
$baseUrlPath = trim(parse_url($this->backendUrl->getBaseUrl(), PHP_URL_PATH), '/');
230+
$routeIndex = empty($baseUrlPath) ? 0 : 1;
231+
$requestUri = $this->_url->getUrl($requestParts[$routeIndex]);
230232
} elseif ($request) {
231233
$requestUri = $request->getRequestUri();
232234
}

app/code/Magento/Backend/Block/Dashboard/Bar.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Backend\Block\Dashboard;
77

8+
use Magento\Directory\Model\Currency;
89
use Magento\Store\Model\Store;
910

1011
/**
@@ -20,10 +21,15 @@ class Bar extends \Magento\Backend\Block\Dashboard\AbstractDashboard
2021
protected $_totals = [];
2122

2223
/**
23-
* @var \Magento\Directory\Model\Currency|null
24+
* @var Currency|null
2425
*/
2526
protected $_currentCurrencyCode = null;
2627

28+
/**
29+
* @var Currency
30+
*/
31+
private $_currency;
32+
2733
/**
2834
* Get totals
2935
*
@@ -67,7 +73,7 @@ public function format($price)
6773
/**
6874
* Setting currency model
6975
*
70-
* @param \Magento\Directory\Model\Currency $currency
76+
* @param Currency $currency
7177
* @return void
7278
*/
7379
public function setCurrency($currency)
@@ -78,7 +84,7 @@ public function setCurrency($currency)
7884
/**
7985
* Retrieve currency model if not set then return currency model for current store
8086
*
81-
* @return \Magento\Directory\Model\Currency
87+
* @return Currency
8288
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
8389
*/
8490
public function getCurrency()

app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Backend\Controller\Adminhtml\Auth;
87

8+
use Magento\Backend\App\Area\FrontNameResolver;
9+
use Magento\Backend\App\BackendAppList;
10+
use Magento\Backend\Model\UrlFactory;
911
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGet;
1012
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPost;
13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Framework\App\Request\Http;
1115

1216
/**
1317
* @api
@@ -20,18 +24,50 @@ class Login extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGe
2024
*/
2125
protected $resultPageFactory;
2226

27+
/**
28+
* @var FrontNameResolver
29+
*/
30+
private $frontNameResolver;
31+
32+
/**
33+
* @var BackendAppList
34+
*/
35+
private $backendAppList;
36+
37+
/**
38+
* @var UrlFactory
39+
*/
40+
private $backendUrlFactory;
41+
42+
/**
43+
* @var Http
44+
*/
45+
private $http;
46+
2347
/**
2448
* Constructor
2549
*
2650
* @param \Magento\Backend\App\Action\Context $context
2751
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
52+
* @param FrontNameResolver|null $frontNameResolver
53+
* @param BackendAppList|null $backendAppList
54+
* @param UrlFactory|null $backendUrlFactory
55+
* @param Http|null $http
2856
*/
2957
public function __construct(
3058
\Magento\Backend\App\Action\Context $context,
31-
\Magento\Framework\View\Result\PageFactory $resultPageFactory
59+
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
60+
FrontNameResolver $frontNameResolver = null,
61+
BackendAppList $backendAppList = null,
62+
UrlFactory $backendUrlFactory = null,
63+
Http $http = null
3264
) {
3365
$this->resultPageFactory = $resultPageFactory;
3466
parent::__construct($context);
67+
$this->frontNameResolver = $frontNameResolver ?? ObjectManager::getInstance()->get(FrontNameResolver::class);
68+
$this->backendAppList = $backendAppList ?? ObjectManager::getInstance()->get(BackendAppList::class);
69+
$this->backendUrlFactory = $backendUrlFactory ?? ObjectManager::getInstance()->get(UrlFactory::class);
70+
$this->http = $http ?? ObjectManager::getInstance()->get(Http::class);
3571
}
3672

3773
/**
@@ -49,7 +85,8 @@ public function execute()
4985
}
5086

5187
$requestUrl = $this->getRequest()->getUri();
52-
if (!$requestUrl->isValid()) {
88+
89+
if (!$requestUrl->isValid() || !$this->isValidBackendUri()) {
5390
return $this->getRedirect($this->getUrl('*'));
5491
}
5592

@@ -69,4 +106,26 @@ private function getRedirect($path)
69106
$resultRedirect->setPath($path);
70107
return $resultRedirect;
71108
}
109+
110+
/**
111+
* Verify if correct backend uri requested.
112+
*
113+
* @return bool
114+
*/
115+
private function isValidBackendUri(): bool
116+
{
117+
$requestUri = $this->getRequest()->getRequestUri();
118+
$backendApp = $this->backendAppList->getCurrentApp();
119+
$baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
120+
if (!$backendApp) {
121+
$backendFrontName = $this->frontNameResolver->getFrontName();
122+
} else {
123+
//In case of application authenticating through the admin login, the script name should be removed
124+
//from the path, because application has own script.
125+
$baseUrl = $this->http->getUrlNoScript($baseUrl);
126+
$backendFrontName = $backendApp->getCookiePath();
127+
}
128+
129+
return strpos($requestUri, $baseUrl . $backendFrontName) === 0;
130+
}
72131
}

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,33 @@
66

77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9+
use Magento\Backend\App\Action\Context;
910
use Magento\Framework\App\Action\HttpPostActionInterface;
11+
use Magento\Framework\Stdlib\DateTime\Filter\Date;
1012
use Magento\Reports\Controller\Adminhtml\Report\Statistics;
13+
use Psr\Log\LoggerInterface;
1114

1215
/**
1316
* Refresh Dashboard statistics action.
1417
*/
1518
class RefreshStatistics extends Statistics implements HttpPostActionInterface
1619
{
1720
/**
18-
* @param \Magento\Backend\App\Action\Context $context
19-
* @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter
21+
* @var LoggerInterface
22+
*/
23+
private $logger;
24+
25+
/**
26+
* @param Context $context
27+
* @param Date $dateFilter
2028
* @param array $reportTypes
21-
* @param \Psr\Log\LoggerInterface $logger
29+
* @param LoggerInterface $logger
2230
*/
2331
public function __construct(
24-
\Magento\Backend\App\Action\Context $context,
25-
\Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter,
32+
Context $context,
33+
Date $dateFilter,
2634
array $reportTypes,
27-
\Psr\Log\LoggerInterface $logger
35+
LoggerInterface $logger
2836
) {
2937
parent::__construct($context, $dateFilter, $reportTypes);
3038
$this->logger = $logger;

app/code/Magento/Backend/Model/Menu/Config.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ class Config
6363
*/
6464
protected $_appState;
6565

66+
/**
67+
* @var Builder
68+
*/
69+
private $_menuBuilder;
70+
6671
/**
6772
* @param \Magento\Backend\Model\Menu\Builder $menuBuilder
6873
* @param \Magento\Backend\Model\Menu\AbstractDirector $menuDirector
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminEnableUrlRewritesConfigData">
12+
<data key="path">web/seo/use_rewrites</data>
13+
<data key="value">1</data>
14+
</entity>
15+
<entity name="AdminDisableUrlRewritesConfigData">
16+
<data key="path">web/seo/use_rewrites</data>
17+
<data key="value">0</data>
18+
</entity>
19+
</entities>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="SystemUploadConfigurationMaxWidth">
11+
<data key="path">system/upload_configuration/max_width</data>
12+
<data key="value">1920</data>
13+
</entity>
14+
<entity name="SystemUploadConfigurationMaxHeight">
15+
<data key="path">system/upload_configuration/max_height</data>
16+
<data key="value">1200</data>
17+
</entity>
18+
</entities>

0 commit comments

Comments
 (0)