Skip to content

Commit 21a8de1

Browse files
committed
Merge branch '2.2-develop' of github.com:magento/magento2 into 2.2-develop-dbmediastorage3
2 parents 36395ef + 5f446e3 commit 21a8de1

File tree

2,169 files changed

+46032
-23075
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,169 files changed

+46032
-23075
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
- [ ] Pull request has a meaningful description of its purpose
3636
- [ ] All commits are accompanied by meaningful commit messages
3737
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
38-
- [ ] All automated tests passed successfully (all builds on Travis CI are green)
38+
- [ ] All automated tests passed successfully (all builds are green)

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ atlassian*
4949
/pub/media/import/*
5050
!/pub/media/import/.htaccess
5151
/pub/media/logo/*
52+
/pub/media/custom_options/*
53+
!/pub/media/custom_options/.htaccess
5254
/pub/media/theme/*
5355
/pub/media/theme_customization/*
5456
!/pub/media/theme_customization/.htaccess

.htaccess

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

3030
############################################
3131
## default index file
32+
## Specifies option, to use methods arguments in backtrace or not
33+
SetEnv MAGE_DEBUG_SHOW_ARGS 1
3234

3335
DirectoryIndex index.php
3436

@@ -364,6 +366,15 @@
364366
Require all denied
365367
</IfVersion>
366368
</Files>
369+
<Files .user.ini>
370+
<IfVersion < 2.4>
371+
order allow,deny
372+
deny from all
373+
</IfVersion>
374+
<IfVersion >= 2.4>
375+
Require all denied
376+
</IfVersion>
377+
</Files>
367378

368379
# For 404s and 403s that aren't handled by the application, show plain 404 response
369380
ErrorDocument 404 /pub/errors/404.php

.htaccess.sample

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,15 @@
341341
Require all denied
342342
</IfVersion>
343343
</Files>
344+
<Files .user.ini>
345+
<IfVersion < 2.4>
346+
order allow,deny
347+
deny from all
348+
</IfVersion>
349+
<IfVersion >= 2.4>
350+
Require all denied
351+
</IfVersion>
352+
</Files>
344353

345354
# For 404s and 403s that aren't handled by the application, show plain 404 response
346355
ErrorDocument 404 /pub/errors/404.php
File renamed without changes.

CHANGELOG.md

Lines changed: 473 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.2-develop)](https://travis-ci.org/magento/magento2)
21
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
32
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
43
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)

app/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Environment initialization
99
*/
1010
error_reporting(E_ALL);
11+
stream_wrapper_unregister('phar');
1112
#ini_set('display_errors', 1);
1213

1314
/* PHP version validation */

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace Magento\AdminNotification\Block\Grid\Renderer;
1010

11+
/**
12+
* Renderer class for action in the admin notifications grid.
13+
*/
1114
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
1215
{
1316
/**
@@ -37,19 +40,23 @@ public function __construct(
3740
*/
3841
public function render(\Magento\Framework\DataObject $row)
3942
{
40-
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' .
43+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
44+
$this->escapeUrl($row->getUrl())
45+
. '">' .
4146
__('Read Details') . '</a>' : '';
4247

43-
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
44-
'*/*/markAsRead/',
45-
['_current' => true, 'id' => $row->getId()]
46-
) . '">' . __(
47-
'Mark as Read'
48-
) . '</a>' : '';
48+
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' .
49+
$this->getUrl(
50+
'*/*/markAsRead/',
51+
['_current' => true, 'id' => $row->getId()]
52+
) . '">' . __(
53+
'Mark as Read'
54+
) . '</a>' : '';
4955

5056
$encodedUrl = $this->_urlHelper->getEncodedUrl();
5157
return sprintf(
52-
'%s%s<a class="action-delete" href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>',
58+
'%s%s<a class="action-delete" href="%s" onclick="deleteConfirm(\'%s\', this.href, {data: {}});' .
59+
' return false;">%s</a>',
5360
$readDetailsHtml,
5461
$markAsReadHtml,
5562
$this->getUrl(

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class Feed extends \Magento\Framework\Model\AbstractModel
2525

2626
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2727

28+
/**
29+
* @var \Magento\Framework\Escaper
30+
*/
31+
private $escaper;
32+
2833
/**
2934
* Feed url
3035
*
@@ -77,6 +82,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
7782
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
7883
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
7984
* @param array $data
85+
* @param \Magento\Framework\Escaper|null $escaper
8086
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8187
*/
8288
public function __construct(
@@ -90,7 +96,8 @@ public function __construct(
9096
\Magento\Framework\UrlInterface $urlBuilder,
9197
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
9298
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
93-
array $data = []
99+
array $data = [],
100+
\Magento\Framework\Escaper $escaper = null
94101
) {
95102
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
96103
$this->_backendConfig = $backendConfig;
@@ -99,12 +106,16 @@ public function __construct(
99106
$this->_deploymentConfig = $deploymentConfig;
100107
$this->productMetadata = $productMetadata;
101108
$this->urlBuilder = $urlBuilder;
109+
$this->escaper = $escaper ?? \Magento\Framework\App\ObjectManager::getInstance()->get(
110+
\Magento\Framework\Escaper::class
111+
);
102112
}
103113

104114
/**
105115
* Init model
106116
*
107117
* @return void
118+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
108119
*/
109120
protected function _construct()
110121
{
@@ -255,6 +266,6 @@ public function getFeedXml()
255266
*/
256267
private function escapeString(\SimpleXMLElement $data)
257268
{
258-
return htmlspecialchars((string)$data);
269+
return $this->escaper->escapeHtml((string)$data);
259270
}
260271
}

0 commit comments

Comments
 (0)