Skip to content

Commit a37e651

Browse files
committed
Merge branch 'paypalflowpro-graphql' of github.com:Usik2203/magento2 into paypalflowpro-graphql
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents d6a2fb7 + d47baa8 commit a37e651

File tree

2,368 files changed

+29471
-10432
lines changed

Some content is hidden

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

2,368 files changed

+29471
-10432
lines changed

CHANGELOG.md

Lines changed: 814 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
10+
<policies>
11+
<policy id="script-src">
12+
<values>
13+
<value id="adobedtm" type="host">assets.adobedtm.com</value>
14+
</values>
15+
</policy>
16+
</policies>
17+
</csp_whitelist>

app/code/Magento/AdminAnalytics/view/adminhtml/templates/notification.phtml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
8+
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
79
?>
810

9-
<script>
11+
<?php
12+
$isAnaliticsVisible = $block->getNotification()->isAnalyticsVisible() ? 1 : 0;
13+
$isReleaseVisible = $block->getNotification()->isReleaseVisible() ? 1 : 0;
14+
$scriptString = <<<script
1015
define('analyticsPopupConfig', function () {
1116
return {
12-
analyticsVisible: <?= $block->getNotification()->isAnalyticsVisible() ? 1 : 0; ?>,
13-
releaseVisible: <?= $block->getNotification()->isReleaseVisible() ? 1 : 0; ?>,
17+
analyticsVisible: {$isAnaliticsVisible},
18+
releaseVisible: {$isReleaseVisible},
1419
}
1520
});
16-
</script>
21+
script;
22+
?>
23+
24+
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>

app/code/Magento/AdminAnalytics/view/adminhtml/templates/tracking.phtml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,28 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
/**
8+
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
9+
*/
610
?>
711

8-
<script src="<?= $block->escapeUrl($block->getTrackingUrl()) ?>" async></script>
9-
<script>
12+
<?= /* @noEscape */ $secureRenderer->renderTag(
13+
'script',
14+
[
15+
'src' => '"' . $block->escapeJs($block->getTrackingUrl()) .'"',
16+
'async' => true,
17+
],
18+
'&nbsp;',
19+
false
20+
) ?>
21+
22+
<?php $scriptString = '
1023
var adminAnalyticsMetadata = {
11-
"version": "<?= $block->escapeJs($block->getMetadata()->getMagentoVersion()) ?>",
12-
"user": "<?= $block->escapeJs($block->getMetadata()->getCurrentUser()) ?>",
13-
"mode": "<?= $block->escapeJs($block->getMetadata()->getMode()) ?>"
24+
"version": "' . $block->escapeJs($block->getMetadata()->getMagentoVersion()) . '",
25+
"user": "' . $block->escapeJs($block->getMetadata()->getCurrentUser()) . '",
26+
"mode": "' . $block->escapeJs($block->getMetadata()->getMode()) . '"
1427
};
15-
</script>
28+
';
29+
?>
30+
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>

app/code/Magento/AdminNotification/Block/System/Messages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Messages extends Template
2626

2727
/**
2828
* @var JsonDataHelper
29-
* @deprecated
29+
* @deprecated 100.3.0
3030
*/
3131
protected $jsonHelper;
3232

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ListAction extends \Magento\Backend\App\AbstractAction
1717

1818
/**
1919
* @var \Magento\Framework\Json\Helper\Data
20-
* @deprecated
20+
* @deprecated 100.3.0
2121
*/
2222
protected $jsonHelper;
2323

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+
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
10+
<policies>
11+
<policy id="img-src">
12+
<values>
13+
<value id="commerce_widgets" type="host">widgets.magentocommerce.com</value>
14+
</values>
15+
</policy>
16+
</policies>
17+
</csp_whitelist>
18+

app/code/Magento/AdminNotification/view/adminhtml/templates/notification/window.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
/**
88
* @see \Magento\AdminNotification\Block\Window
9+
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
910
*/
1011
?>
1112
<ul class="message-system-list"
12-
style="display: none;"
1313
data-mage-init='{
1414
"Magento_Ui/js/modal/modal": {
1515
"autoOpen": true,
@@ -25,3 +25,4 @@
2525
</a>
2626
</li>
2727
</ul>
28+
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag('display:none', '.message-system-list'); ?>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
*/
66

77
/** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */
8+
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
89
?>
910

10-
<div style="display:none" id="system_messages_list" data-role="system_messages_list"
11+
<div id="system_messages_list" data-role="system_messages_list"
1112
title="<?= $block->escapeHtmlAttr($block->getPopupTitle()) ?>">
1213
<ul class="message-system-list messages">
13-
<?php foreach ($block->getUnreadMessages() as $message) : ?>
14+
<?php foreach ($block->getUnreadMessages() as $message): ?>
1415
<li class="message message-warning <?= $block->escapeHtmlAttr($block->getItemClass($message)) ?>">
1516
<?= $block->escapeHtml($message->getText()) ?>
1617
</li>
1718
<?php endforeach;?>
1819
</ul>
1920
</div>
21+
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag('display:none', '#system_messages_list'); ?>
2022

2123
<script type="text/x-magento-init">
2224
{

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ private function prepareExportData(
381381
* @param array $exportData
382382
* @return array
383383
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
384-
* @deprecated
384+
* @deprecated 100.3.0
385385
* @see prepareExportData
386386
*/
387387
protected function correctExportData($exportData)
@@ -510,7 +510,7 @@ private function fetchTierPrices(array $productIds): array
510510
* @return array|bool
511511
* @SuppressWarnings(PHPMD.NPathComplexity)
512512
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
513-
* @deprecated
513+
* @deprecated 100.3.0
514514
* @see fetchTierPrices
515515
*/
516516
protected function getTierPrices(array $listSku, $table)

app/code/Magento/AdvancedSearch/Model/Client/ClientResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ClientResolver
2020
*
2121
* @var ScopeConfigInterface
2222
* @since 100.1.0
23-
* @deprecated since it is not used anymore
23+
* @deprecated 100.3.0 since it is not used anymore
2424
*/
2525
protected $scopeConfig;
2626

@@ -56,14 +56,14 @@ class ClientResolver
5656
*
5757
* @var string
5858
* @since 100.1.0
59-
* @deprecated since it is not used anymore
59+
* @deprecated 100.3.0 since it is not used anymore
6060
*/
6161
protected $path;
6262

6363
/**
6464
* Config Scope
6565
* @since 100.1.0
66-
* @deprecated since it is not used anymore
66+
* @deprecated 100.3.0 since it is not used anymore
6767
*/
6868
protected $scope;
6969

app/code/Magento/Analytics/Model/Connector/Http/ConverterInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,35 @@
99
* Represents converter interface for http request and response body.
1010
*
1111
* @api
12+
* @since 100.2.0
1213
*/
1314
interface ConverterInterface
1415
{
1516
/**
1617
* @param string $body
1718
*
1819
* @return array
20+
* @since 100.2.0
1921
*/
2022
public function fromBody($body);
2123

2224
/**
2325
* @param array $data
2426
*
2527
* @return string
28+
* @since 100.2.0
2629
*/
2730
public function toBody(array $data);
2831

2932
/**
3033
* @return string
34+
* @since 100.2.0
3135
*/
3236
public function getContentTypeHeader();
3337

3438
/**
3539
* @return string
40+
* @since 100.3.0
3641
*/
3742
public function getContentMediaType(): string;
3843
}

app/code/Magento/Analytics/Model/ReportWriter.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Model;
79

810
use Magento\Analytics\ReportXml\DB\ReportValidator;
911
use Magento\Framework\Filesystem\Directory\WriteInterface;
1012

1113
/**
1214
* Writes reports in files in csv format
13-
* @inheritdoc
1415
*/
1516
class ReportWriter implements ReportWriterInterface
1617
{
@@ -54,7 +55,7 @@ public function __construct(
5455
}
5556

5657
/**
57-
* {@inheritdoc}
58+
* @inheritdoc
5859
*/
5960
public function write(WriteInterface $directory, $path)
6061
{
@@ -81,7 +82,7 @@ public function write(WriteInterface $directory, $path)
8182
$headers = array_keys($row);
8283
$stream->writeCsv($headers);
8384
}
84-
$stream->writeCsv($row);
85+
$stream->writeCsv($this->prepareRow($row));
8586
}
8687
$stream->unlock();
8788
$stream->close();
@@ -98,4 +99,18 @@ public function write(WriteInterface $directory, $path)
9899

99100
return true;
100101
}
102+
103+
/**
104+
* Replace wrong symbols in row
105+
*
106+
* @param array $row
107+
* @return array
108+
*/
109+
private function prepareRow(array $row): array
110+
{
111+
$row = preg_replace('/(?<!\\\\)"/', '\\"', $row);
112+
$row = preg_replace('/[\\\\]+/', '\\', $row);
113+
114+
return $row;
115+
}
101116
}

app/code/Magento/Analytics/ReportXml/Query.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public function getConfig()
8181
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
8282
* @return mixed data which can be serialized by <b>json_encode</b>,
8383
* which is a value of any type other than a resource.
84-
* @since 5.4.0
8584
*/
8685
public function jsonSerialize()
8786
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CollectionTimeLabelTest extends TestCase
5959
protected function setUp(): void
6060
{
6161
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
62-
->setMethods(['getComment'])
62+
->setMethods(['getComment', 'getElementHtml'])
6363
->disableOriginalConstructor()
6464
->getMock();
6565

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function setUp(): void
4949
$this->subscriptionStatusProviderMock = $this->createMock(SubscriptionStatusProvider::class);
5050
$this->contextMock = $this->createMock(Context::class);
5151
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
52-
->setMethods(['getComment'])
52+
->setMethods(['getComment', 'getElementHtml'])
5353
->disableOriginalConstructor()
5454
->getMock();
5555

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class VerticalTest extends TestCase
4141
protected function setUp(): void
4242
{
4343
$this->abstractElementMock = $this->getMockBuilder(AbstractElement::class)
44-
->setMethods(['getComment', 'getLabel', 'getHint'])
44+
->setMethods(['getComment', 'getLabel', 'getHint', 'getElementHtml'])
4545
->disableOriginalConstructor()
4646
->getMock();
4747

0 commit comments

Comments
 (0)