Skip to content

Commit a4b87ce

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch '2.1-develop' into MAGETWO-72280
2 parents 40c109e + 86c9cad commit a4b87ce

File tree

670 files changed

+17139
-7103
lines changed

Some content is hidden

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

670 files changed

+17139
-7103
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ atlassian*
2323
/lib/internal/flex/varien/.settings
2424
/node_modules
2525
/.grunt
26+
/Gruntfile.js
27+
/package.json
2628

2729
/pub/media/*.*
2830
!/pub/media/.htaccess

.htaccess

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# All explanations you could find in .htaccess.sample file
22
DirectoryIndex index.php
33
<IfModule mod_php5.c>
4-
php_value memory_limit 768M
4+
php_value memory_limit 756M
55
php_value max_execution_time 18000
66
php_flag session.auto_start off
77
php_flag suhosin.session.cryptua off
88
</IfModule>
99
<IfModule mod_php7.c>
10-
php_value memory_limit 768M
10+
php_value memory_limit 756M
1111
php_value max_execution_time 18000
1212
php_flag session.auto_start off
1313
php_flag suhosin.session.cryptua off

.htaccess.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DirectoryIndex index.php
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 @@ DirectoryIndex index.php
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
############################################

.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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
class ListAction extends \Magento\Backend\App\AbstractAction
1010
{
11+
/**
12+
* Authorization level of a basic admin session.
13+
*
14+
* @see _isAllowed()
15+
*/
16+
const ADMIN_RESOURCE = 'Magento_AdminNotification::show_list';
17+
1118
/**
1219
* @var \Magento\Framework\Json\Helper\Data
1320
*/

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ public function checkUpdate()
146146
$feedData[] = [
147147
'severity' => (int)$item->severity,
148148
'date_added' => date('Y-m-d H:i:s', $itemPublicationDate),
149-
'title' => (string)$item->title,
150-
'description' => (string)$item->description,
151-
'url' => (string)$item->link,
149+
'title' => $this->escapeString($item->title),
150+
'description' => $this->escapeString($item->description),
151+
'url' => $this->escapeString($item->link),
152152
];
153153
}
154154
}
@@ -244,4 +244,15 @@ public function getFeedXml()
244244

245245
return $xml;
246246
}
247+
248+
/**
249+
* Converts incoming data to string format and escapes special characters.
250+
*
251+
* @param \SimpleXMLElement $data
252+
* @return string
253+
*/
254+
private function escapeString(\SimpleXMLElement $data)
255+
{
256+
return htmlspecialchars((string)$data);
257+
}
247258
}

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

Lines changed: 65 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,25 @@ class FeedTest extends \PHPUnit_Framework_TestCase
5252

5353
protected function setUp()
5454
{
55-
$this->inboxFactory = $this->getMock('Magento\AdminNotification\Model\InboxFactory', ['create'], [], '', false);
56-
$this->curlFactory = $this->getMock('Magento\Framework\HTTP\Adapter\CurlFactory', ['create'], [], '', false);
57-
$this->curl = $this->getMockBuilder('Magento\Framework\HTTP\Adapter\Curl')
55+
$this->inboxFactory = $this->getMock(
56+
\Magento\AdminNotification\Model\InboxFactory::class,
57+
['create'],
58+
[],
59+
'',
60+
false
61+
);
62+
$this->curlFactory = $this->getMock(
63+
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
64+
['create'],
65+
[],
66+
'',
67+
false
68+
);
69+
$this->curl = $this->getMockBuilder(\Magento\Framework\HTTP\Adapter\Curl::class)
5870
->disableOriginalConstructor()->getMock();
59-
$this->appState = $this->getMock('Magento\Framework\App\State', ['getInstallDate'], [], '', false);
71+
$this->appState = $this->getMock(\Magento\Framework\App\State::class, ['getInstallDate'], [], '', false);
6072
$this->inboxModel = $this->getMock(
61-
'Magento\AdminNotification\Model\Inbox',
73+
\Magento\AdminNotification\Model\Inbox::class,
6274
[
6375
'__wakeup',
6476
'parse'
@@ -68,15 +80,15 @@ protected function setUp()
6880
false
6981
);
7082
$this->backendConfig = $this->getMock(
71-
'Magento\Backend\App\ConfigInterface',
83+
\Magento\Backend\App\ConfigInterface::class,
7284
[
7385
'getValue',
7486
'setValue',
7587
'isSetFlag'
7688
]
7789
);
7890
$this->cacheManager = $this->getMock(
79-
'Magento\Framework\App\CacheInterface',
91+
\Magento\Framework\App\CacheInterface::class,
8092
[
8193
'load',
8294
'getFrontend',
@@ -86,18 +98,18 @@ protected function setUp()
8698
]
8799
);
88100

89-
$this->deploymentConfig = $this->getMockBuilder('Magento\Framework\App\DeploymentConfig')
101+
$this->deploymentConfig = $this->getMockBuilder(\Magento\Framework\App\DeploymentConfig::class)
90102
->disableOriginalConstructor()->getMock();
91103

92104
$this->objectManagerHelper = new ObjectManagerHelper($this);
93105

94-
$this->productMetadata = $this->getMockBuilder('Magento\Framework\App\ProductMetadata')
106+
$this->productMetadata = $this->getMockBuilder(\Magento\Framework\App\ProductMetadata::class)
95107
->disableOriginalConstructor()->getMock();
96108

97-
$this->urlBuilder = $this->getMock('Magento\Framework\UrlInterface');
109+
$this->urlBuilder = $this->getMock(\Magento\Framework\UrlInterface::class);
98110

99111
$this->feed = $this->objectManagerHelper->getObject(
100-
'Magento\AdminNotification\Model\Feed',
112+
\Magento\AdminNotification\Model\Feed::class,
101113
[
102114
'backendConfig' => $this->backendConfig,
103115
'cacheManager' => $this->cacheManager,
@@ -148,8 +160,27 @@ public function testCheckUpdate($callInbox, $curlRequest)
148160
->will($this->returnValue('Sat, 6 Sep 2014 16:46:11 UTC'));
149161
if ($callInbox) {
150162
$this->inboxFactory->expects($this->once())->method('create')
151-
->will(($this->returnValue($this->inboxModel)));
152-
$this->inboxModel->expects($this->once())->method('parse')->will($this->returnSelf());
163+
->will($this->returnValue($this->inboxModel));
164+
$this->inboxModel->expects($this->once())
165+
->method('parse')
166+
->with(
167+
$this->callback(
168+
function ($data) {
169+
$fieldsToCheck = ['title', 'description', 'url'];
170+
return array_reduce(
171+
$fieldsToCheck,
172+
function ($initialValue, $item) use ($data) {
173+
$haystack = (isset($data[0][$item]) ? $data[0][$item] : false);
174+
return $haystack
175+
? $initialValue && !strpos($haystack, '<') && !strpos($haystack, '>')
176+
: true;
177+
},
178+
true
179+
);
180+
}
181+
)
182+
)
183+
->will($this->returnSelf());
153184
} else {
154185
$this->inboxFactory->expects($this->never())->method('create');
155186
$this->inboxModel->expects($this->never())->method('parse');
@@ -199,7 +230,27 @@ public function checkUpdateDataProvider()
199230
</item>
200231
</channel>
201232
</rss>'
202-
]
233+
],
234+
[
235+
true,
236+
// @codingStandardsIgnoreStart
237+
'HEADER
238+
239+
<?xml version="1.0" encoding="utf-8" ?>
240+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
241+
<channel>
242+
<title>MagentoCommerce</title>
243+
<item>
244+
<title><![CDATA[<script>alert("Hello!");</script>Test Title]]></title>
245+
<link><![CDATA[http://magento.com/feed_url<script>alert("Hello!");</script>]]></link>
246+
<severity>4</severity>
247+
<description><![CDATA[Test <script>alert("Hello!");</script>Description]]></description>
248+
<pubDate>Tue, 20 Jun 2017 13:14:47 UTC</pubDate>
249+
</item>
250+
</channel>
251+
</rss>'
252+
// @codingStandardsIgnoreEnd
253+
],
203254
];
204255
}
205256
}

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lib-libxml": "*"
1111
},
1212
"type": "magento2-module",
13-
"version": "100.1.2",
13+
"version": "100.1.3",
1414
"license": [
1515
"OSL-3.0",
1616
"AFL-3.0"

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/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
define(
66
[
77
'jquery',
8-
'Magento_Payment/js/view/payment/iframe'
8+
'Magento_Payment/js/view/payment/iframe',
9+
'mage/translate'
910
],
10-
function ($, Component) {
11+
function ($, Component, $t) {
1112
'use strict';
1213

1314
return Component.extend({
1415
defaults: {
1516
template: 'Magento_Authorizenet/payment/authorizenet-directpost',
16-
timeoutMessage: 'Sorry, but something went wrong. Please contact the seller.'
17+
timeoutMessage: $t('Sorry, but something went wrong. Please contact the seller.')
1718
},
1819
placeOrderHandler: null,
1920
validateHandler: null,

0 commit comments

Comments
 (0)