Skip to content

Commit b6dcdea

Browse files
Merge remote-tracking branch 'mainline/2.3-develop' into MC-16650
2 parents 9f57148 + adee85d commit b6dcdea

File tree

4,587 files changed

+201345
-43609
lines changed

Some content is hidden

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

4,587 files changed

+201345
-43609
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Magento 2 development team or community maintainers will review all issues a
1111
During the review we might require clarifications from the contributor.
1212
If there is no response from the contributor within two weeks, the pull request will be closed.
1313

14-
For more detialed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
14+
For more detailed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
1515

1616
## Contribution requirements
1717

CHANGELOG.md

Lines changed: 614 additions & 2 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ To learn about issues, click [here][2]. To open an issue, click [here][3].
2020

2121
To suggest documentation improvements, click [here][4].
2222

23-
[1]: <https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html>
24-
[2]: <https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report>
25-
[3]: <https://github.com/magento/magento2/issues>
26-
[4]: <https://devdocs.magento.com>
23+
[1]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html
24+
[2]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report
25+
[3]: https://github.com/magento/magento2/issues
26+
[4]: https://devdocs.magento.com
2727

2828
<h3>Community Maintainers</h3>
2929
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.

SECURITY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Reporting Security Issues
2+
3+
Magento values the contributions of the security research community, and we look forward to working with you to minimize risk to Magento merchants.
4+
5+
## Where should I report security issues?
6+
7+
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/magento). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
8+
9+
## Learning More About Security
10+
To learn more about securing a Magento store, please visit the [Security Center](https://magento.com/security).

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

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

8+
use Magento\Framework\Escaper;
9+
use Magento\Framework\App\ObjectManager;
810
use Magento\Framework\Config\ConfigOptionsListConstants;
911

1012
/**
@@ -25,6 +27,11 @@ class Feed extends \Magento\Framework\Model\AbstractModel
2527

2628
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2729

30+
/**
31+
* @var Escaper
32+
*/
33+
private $escaper;
34+
2835
/**
2936
* Feed url
3037
*
@@ -77,6 +84,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
7784
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
7885
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
7986
* @param array $data
87+
* @param Escaper|null $escaper
8088
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8189
*/
8290
public function __construct(
@@ -90,21 +98,26 @@ public function __construct(
9098
\Magento\Framework\UrlInterface $urlBuilder,
9199
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
92100
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
93-
array $data = []
101+
array $data = [],
102+
Escaper $escaper = null
94103
) {
95104
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
96-
$this->_backendConfig = $backendConfig;
97-
$this->_inboxFactory = $inboxFactory;
98-
$this->curlFactory = $curlFactory;
105+
$this->_backendConfig = $backendConfig;
106+
$this->_inboxFactory = $inboxFactory;
107+
$this->curlFactory = $curlFactory;
99108
$this->_deploymentConfig = $deploymentConfig;
100-
$this->productMetadata = $productMetadata;
101-
$this->urlBuilder = $urlBuilder;
109+
$this->productMetadata = $productMetadata;
110+
$this->urlBuilder = $urlBuilder;
111+
$this->escaper = $escaper ?? ObjectManager::getInstance()->get(
112+
Escaper::class
113+
);
102114
}
103115

104116
/**
105117
* Init model
106118
*
107119
* @return void
120+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
108121
*/
109122
protected function _construct()
110123
{
@@ -252,6 +265,6 @@ public function getFeedXml()
252265
*/
253266
private function escapeString(\SimpleXMLElement $data)
254267
{
255-
return htmlspecialchars((string)$data);
268+
return $this->escaper->escapeHtml((string)$data);
256269
}
257270
}
Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
1-
# Admin Notification
1+
# Magento_AdminNotification module
22

3-
**Admin Notification** provides the ability to alert administrators via
4-
system messages and provides a message inbox for surveys and notifications.
3+
The Magento_AdminNotification module provides the ability to alert administrators via system messages and provides a message inbox for surveys and notifications.
4+
5+
## Installation details
6+
7+
The Magento_AdminNotification module creates the following tables in the database:
8+
- `adminnotification_inbox`
9+
- `admin_system_messages`
10+
11+
Before disabling or uninstalling this module, note that the Magento_Indexer module depends on this module.
12+
13+
For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html).
14+
15+
## Extensibility
16+
17+
Extension developers can interact with the Magento_AdminNotification module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
18+
19+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdminNotification module.
20+
21+
### Events
22+
23+
This module observes the following events:
24+
25+
- `controller_action_predispatch` event in `Magento\AdminNotification\Observer\PredispatchAdminActionControllerObserver` file.
26+
27+
### Layouts
28+
29+
This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory:
30+
31+
- `adminhtml_notification_index`
32+
- `adminhtml_notification_block`
33+
34+
For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html).
35+
36+
### UI components
37+
38+
You can extend admin notifications using the `view/adminhtml/ui_component/notification_area.xml` configuration file.
39+
40+
For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSystemMessagesSection">
12+
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/>
13+
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/>
14+
</section>
15+
</sections>

app/code/Magento/AdminNotification/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~7.1.3||~7.2.0",
8+
"php": "~7.1.3||~7.2.0||~7.3.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",
1212
"magento/module-media-storage": "*",
1313
"magento/module-store": "*",
14-
"magento/module-ui": "*"
14+
"magento/module-ui": "*",
15+
"magento/module-config": "*"
1516
},
1617
"type": "magento2-module",
1718
"license": [

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
9-
?>
10-
<?php
117
/**
128
* @see \Magento\AdminNotification\Block\Window
139
*/
@@ -19,11 +15,13 @@
1915
"autoOpen": true,
2016
"buttons": false,
2117
"modalClass": "modal-system-messages",
22-
"title": "<?= /* @escapeNotVerified */ $block->getHeaderText() ?>"
18+
"title": "<?= $block->escapeHtmlAttr($block->getHeaderText()) ?>"
2319
}
2420
}'>
2521
<li class="message message-warning warning">
26-
<?= /* @escapeNotVerified */ $block->getNoticeMessageText() ?><br/>
27-
<a href="<?= /* @escapeNotVerified */ $block->getNoticeMessageUrl() ?>"><?= /* @escapeNotVerified */ $block->getReadDetailsText() ?></a>
22+
<?= $block->escapeHtml($block->getNoticeMessageText()) ?><br/>
23+
<a href="<?= $block->escapeUrl($block->getNoticeMessageUrl()) ?>">
24+
<?= $block->escapeHtml($block->getReadDetailsText()) ?>
25+
</a>
2826
</li>
2927
</ul>

0 commit comments

Comments
 (0)