Skip to content

Commit f4afad2

Browse files
author
Oleksii Korshenko
committed
Merge remote-tracking branch 'public/2.3-develop' into translation-fix
2 parents b16e763 + 07ed4b2 commit f4afad2

File tree

1,312 files changed

+66672
-43951
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,312 files changed

+66672
-43951
lines changed

.htaccess

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
############################################
3737
## adjust memory limit
3838

39-
php_value memory_limit 768M
39+
php_value memory_limit 756M
4040
php_value max_execution_time 18000
4141

4242
############################################
@@ -59,7 +59,7 @@
5959
############################################
6060
## adjust memory limit
6161

62-
php_value memory_limit 768M
62+
php_value memory_limit 756M
6363
php_value max_execution_time 18000
6464

6565
############################################

.htaccess.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
############################################
3636
## adjust memory limit
3737

38-
php_value memory_limit 768M
38+
php_value memory_limit 756M
3939
php_value max_execution_time 18000
4040

4141
############################################

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ install: composer install --no-interaction
5252
before_script: ./dev/travis/before_script.sh
5353
script:
5454
# Set arguments for variants of phpunit based tests; '|| true' prevents failing script when leading test fails
55-
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
5655
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true
5756

5857
# The scripts for grunt/phpunit type tests

.user.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
memory_limit = 768M
1+
memory_limit = 756M
22
max_execution_time = 18000
33
session.auto_start = off
44
suhosin.session.cryptua = off

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
class ListAction extends \Magento\Backend\App\AbstractAction
1010
{
11+
/**
12+
* Authorization level of a basic admin session
13+
*/
14+
const ADMIN_RESOURCE = 'Magento_AdminNotification::show_list';
15+
1116
/**
1217
* @var \Magento\Framework\Json\Helper\Data
1318
*/

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ public function checkUpdate()
148148
$feedData[] = [
149149
'severity' => (int)$item->severity,
150150
'date_added' => date('Y-m-d H:i:s', $itemPublicationDate),
151-
'title' => (string)$item->title,
152-
'description' => (string)$item->description,
153-
'url' => (string)$item->link,
151+
'title' => $this->escapeString($item->title),
152+
'description' => $this->escapeString($item->description),
153+
'url' => $this->escapeString($item->link),
154154
];
155155
}
156156
}
@@ -246,4 +246,15 @@ public function getFeedXml()
246246

247247
return $xml;
248248
}
249+
250+
/**
251+
* Converts incoming data to string format and escapes special characters.
252+
*
253+
* @param \SimpleXMLElement $data
254+
* @return string
255+
*/
256+
private function escapeString(\SimpleXMLElement $data)
257+
{
258+
return htmlspecialchars((string)$data);
259+
}
249260
}

app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,27 @@ public function testCheckUpdate($callInbox, $curlRequest)
145145
->will($this->returnValue('Sat, 6 Sep 2014 16:46:11 UTC'));
146146
if ($callInbox) {
147147
$this->inboxFactory->expects($this->once())->method('create')
148-
->will(($this->returnValue($this->inboxModel)));
149-
$this->inboxModel->expects($this->once())->method('parse')->will($this->returnSelf());
148+
->will($this->returnValue($this->inboxModel));
149+
$this->inboxModel->expects($this->once())
150+
->method('parse')
151+
->with(
152+
$this->callback(
153+
function ($data) {
154+
$fieldsToCheck = ['title', 'description', 'url'];
155+
return array_reduce(
156+
$fieldsToCheck,
157+
function ($initialValue, $item) use ($data) {
158+
$haystack = $data[0][$item] ?? false;
159+
return $haystack
160+
? $initialValue && !strpos($haystack, '<') && !strpos($haystack, '>')
161+
: true;
162+
},
163+
true
164+
);
165+
}
166+
)
167+
)
168+
->will($this->returnSelf());
150169
} else {
151170
$this->inboxFactory->expects($this->never())->method('create');
152171
$this->inboxModel->expects($this->never())->method('parse');
@@ -196,7 +215,27 @@ public function checkUpdateDataProvider()
196215
</item>
197216
</channel>
198217
</rss>'
199-
]
218+
],
219+
[
220+
true,
221+
// @codingStandardsIgnoreStart
222+
'HEADER
223+
224+
<?xml version="1.0" encoding="utf-8" ?>
225+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
226+
<channel>
227+
<title>MagentoCommerce</title>
228+
<item>
229+
<title><![CDATA[<script>alert("Hello!");</script>Test Title]]></title>
230+
<link><![CDATA[http://magento.com/feed_url<script>alert("Hello!");</script>]]></link>
231+
<severity>4</severity>
232+
<description><![CDATA[Test <script>alert("Hello!");</script>Description]]></description>
233+
<pubDate>Tue, 20 Jun 2017 13:14:47 UTC</pubDate>
234+
</item>
235+
</channel>
236+
</rss>'
237+
// @codingStandardsIgnoreEnd
238+
],
200239
];
201240
}
202241
}

app/code/Magento/AdminNotification/composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
22
"name": "magento/module-admin-notification",
33
"description": "N/A",
4+
"config": {
5+
"sort-packages": true
6+
},
47
"require": {
58
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
6-
"magento/module-store": "100.3.*",
9+
"lib-libxml": "*",
10+
"magento/framework": "100.3.*",
711
"magento/module-backend": "100.3.*",
812
"magento/module-media-storage": "100.3.*",
9-
"magento/framework": "100.3.*",
10-
"magento/module-ui": "100.3.*",
11-
"lib-libxml": "*"
13+
"magento/module-store": "100.3.*",
14+
"magento/module-ui": "100.3.*"
1215
},
1316
"type": "magento2-module",
1417
"version": "100.3.0-dev",

app/code/Magento/AdminNotification/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<feed_url>notifications.magentocommerce.com/magento2/community/notifications.rss</feed_url>
1313
<popup_url>widgets.magentocommerce.com/notificationPopup</popup_url>
1414
<severity_icons_url>widgets.magentocommerce.com/%s/%s.gif</severity_icons_url>
15-
<use_https>0</use_https>
15+
<use_https>1</use_https>
1616
<frequency>1</frequency>
1717
<last_update>0</last_update>
1818
</adminnotification>

app/code/Magento/AdminNotification/view/adminhtml/layout/adminhtml_notification_block.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
<arguments>
2121
<argument name="filter_visibility" xsi:type="string">0</argument>
2222
</arguments>
23-
<block class="Magento\Backend\Block\Widget\Grid\Column" as="severity">
23+
<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.notification.container.grid.columnSet.severity" as="severity">
2424
<arguments>
2525
<argument name="header" xsi:type="string" translate="true">Severity</argument>
2626
<argument name="index" xsi:type="string">severity</argument>
2727
<argument name="renderer" xsi:type="string">Magento\AdminNotification\Block\Grid\Renderer\Severity</argument>
2828
</arguments>
2929
</block>
30-
<block class="Magento\Backend\Block\Widget\Grid\Column" as="date_added">
30+
<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.notification.container.grid.columnSet.date_added" as="date_added">
3131
<arguments>
3232
<argument name="header" xsi:type="string" translate="true">Date Added</argument>
3333
<argument name="id" xsi:type="string">date_added</argument>
@@ -37,14 +37,14 @@
3737
<argument name="header_css_class" xsi:type="string">col-date</argument>
3838
</arguments>
3939
</block>
40-
<block class="Magento\Backend\Block\Widget\Grid\Column" as="title">
40+
<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.notification.container.grid.columnSet.title" as="title">
4141
<arguments>
4242
<argument name="header" xsi:type="string" translate="true">Message</argument>
4343
<argument name="index" xsi:type="string">title</argument>
4444
<argument name="renderer" xsi:type="string">Magento\AdminNotification\Block\Grid\Renderer\Notice</argument>
4545
</arguments>
4646
</block>
47-
<block class="Magento\Backend\Block\Widget\Grid\Column" as="actions">
47+
<block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.notification.container.grid.columnSet.actions" as="actions">
4848
<arguments>
4949
<argument name="header" xsi:type="string" translate="true">Actions</argument>
5050
<argument name="sortable" xsi:type="string">0</argument>

0 commit comments

Comments
 (0)