Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.3-develop' into issue/732
Browse files Browse the repository at this point in the history
  • Loading branch information
naydav committed Jun 21, 2019
2 parents bbe60dd + 5177344 commit 0e59bcf
Show file tree
Hide file tree
Showing 784 changed files with 21,484 additions and 7,053 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Magento 2 development team or community maintainers will review all issues a
During the review we might require clarifications from the contributor.
If there is no response from the contributor within two weeks, the pull request will be closed.

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

## Contribution requirements

Expand Down
27 changes: 20 additions & 7 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\AdminNotification\Model;

use Magento\Framework\Escaper;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Config\ConfigOptionsListConstants;

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

const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';

/**
* @var Escaper
*/
private $escaper;

/**
* Feed url
*
Expand Down Expand Up @@ -77,6 +84,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
* @param Escaper|null $escaper
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -90,21 +98,26 @@ public function __construct(
\Magento\Framework\UrlInterface $urlBuilder,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
array $data = [],
Escaper $escaper = null
) {
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
$this->_backendConfig = $backendConfig;
$this->_inboxFactory = $inboxFactory;
$this->curlFactory = $curlFactory;
$this->_backendConfig = $backendConfig;
$this->_inboxFactory = $inboxFactory;
$this->curlFactory = $curlFactory;
$this->_deploymentConfig = $deploymentConfig;
$this->productMetadata = $productMetadata;
$this->urlBuilder = $urlBuilder;
$this->productMetadata = $productMetadata;
$this->urlBuilder = $urlBuilder;
$this->escaper = $escaper ?? ObjectManager::getInstance()->get(
Escaper::class
);
}

/**
* Init model
*
* @return void
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
*/
protected function _construct()
{
Expand Down Expand Up @@ -252,6 +265,6 @@ public function getFeedXml()
*/
private function escapeString(\SimpleXMLElement $data)
{
return htmlspecialchars((string)$data);
return $this->escaper->escapeHtml((string)$data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

?>
<?php
/**
* @see \Magento\AdminNotification\Block\Window
*/
Expand All @@ -19,11 +15,13 @@
"autoOpen": true,
"buttons": false,
"modalClass": "modal-system-messages",
"title": "<?= /* @escapeNotVerified */ $block->getHeaderText() ?>"
"title": "<?= $block->escapeHtmlAttr($block->getHeaderText()) ?>"
}
}'>
<li class="message message-warning warning">
<?= /* @escapeNotVerified */ $block->getNoticeMessageText() ?><br/>
<a href="<?= /* @escapeNotVerified */ $block->getNoticeMessageUrl() ?>"><?= /* @escapeNotVerified */ $block->getReadDetailsText() ?></a>
<?= $block->escapeHtml($block->getNoticeMessageText()) ?><br/>
<a href="<?= $block->escapeUrl($block->getNoticeMessageUrl()) ?>">
<?= $block->escapeHtml($block->getReadDetailsText()) ?>
</a>
</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/** @var $block \Magento\AdminNotification\Block\System\Messages */
?>
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages */ ?>

<?php $lastCritical = $block->getLastCritical();?>
<div id="system_messages" class="message-system<?php if ($lastCritical): ?> message-system-unread<?php endif; ?>">
<div id="system_messages"
class="message-system<?php if ($lastCritical) : ?>
message-system-unread<?php endif; ?>">
<div class="message-system-inner">
<?php if ($lastCritical): ?>
<?php if ($lastCritical) : ?>
<ul class="message-system-list">
<li class="message message-warning error">
<?= /* @escapeNotVerified */ $lastCritical->getText() ?>
<?= $block->escapeHtml($lastCritical->getText()) ?>
</li>
</ul>
<?php endif; ?>
<div class="message-system-short">
<span class="message-system-short-label">
<?= /* @escapeNotVerified */ __('System Messages:') ?>
<?= $block->escapeHtml(__('System Messages:')) ?>
</span>

<?php if ($block->getCriticalCount()): ?>
<?php if ($block->getCriticalCount()) : ?>
<div class="message message-warning error">
<a class="message-link" href="#" title="<?= $block->escapeHtml(__('Critical System Messages')) ?>">
<?= /* @escapeNotVerified */ $block->getCriticalCount() ?>
<?= (int) $block->getCriticalCount() ?>
</a>
</div>
<?php endif;?>
<?php endif; ?>

<?php if ($block->getMajorCount()): ?>
<?php if ($block->getMajorCount()) : ?>
<div class="message message-warning warning">
<a class="message-link" href="#" title="<?= $block->escapeHtml(__('Major System Messages')) ?>">
<?= /* @escapeNotVerified */ $block->getMajorCount() ?>
<?= (int) $block->getMajorCount() ?>
</a>
</div>
<?php endif;?>
<?php endif; ?>
</div>
<div id="message-system-all" title="<?= $block->escapeHtml(__('System messages')) ?>" data-mage-init='<?= $block->escapeHtml($block->getSystemMessageDialogJson()) ?>'></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */
?>
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */ ?>

<div style="display:none" id="system_messages_list" data-role="system_messages_list" title="<?= $block->escapeHtml($block->getPopupTitle()) ?>">
<div style="display:none" id="system_messages_list" data-role="system_messages_list"
title="<?= $block->escapeHtmlAttr($block->getPopupTitle()) ?>">
<ul class="message-system-list messages">
<?php foreach ($block->getUnreadMessages() as $message): ?>
<li class="message message-warning <?= /* @escapeNotVerified */ $block->getItemClass($message) ?>">
<?= /* @escapeNotVerified */ $message->getText() ?>
<?php foreach ($block->getUnreadMessages() as $message) : ?>
<li class="message message-warning <?= $block->escapeHtmlAttr($block->getItemClass($message)) ?>">
<?= $block->escapeHtml($message->getText()) ?>
</li>
<?php endforeach;?>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,78 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/** @var $this \Magento\AdminNotification\Block\ToolbarEntry */

?>
<?php /** @var $this \Magento\AdminNotification\Block\ToolbarEntry */ ?>
<?php
$notificationCount = $block->getUnreadNotificationCount();
$notificationCounterMax = $block->getNotificationCounterMax();
?>
<div
data-mage-init='{"toolbarEntry": {}}'
class="notifications-wrapper admin__action-dropdown-wrap"
data-notification-count="<?= /* @escapeNotVerified */ $notificationCount ?>">
data-notification-count="<?= (int)$notificationCount ?>">
<?php if ($notificationCount > 0) : ?>
<a
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"
class="notifications-action admin__action-dropdown"
data-mage-init='{"dropdown":{}}'
title="<?= /* @escapeNotVerified */ __('Notifications') ?>"
title="<?= $block->escapeHtmlAttr(__('Notifications')) ?>"
data-toggle="dropdown">
<span class="notifications-counter">
<?= /* @escapeNotVerified */ ($notificationCount > $notificationCounterMax) ? $notificationCounterMax . '+' : $notificationCount ?>
<?= /* @noEscape */ ($notificationCount > $notificationCounterMax) ? (int)$notificationCounterMax . '+' : (int)$notificationCount ?>
</span>
</a>
<ul
class="admin__action-dropdown-menu"
data-mark-as-read-url="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/ajaxMarkAsRead') ?>">
data-mark-as-read-url="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/ajaxMarkAsRead')) ?>">
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox*/ ?>
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
data-notification-id="<?= /* @escapeNotVerified */ $notification->getId() ?>"
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
<?php
$notificationDescription = $block->escapeHtml($notification->getDescription());
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
?>
<strong class="notifications-entry-title">
<?= $block->escapeHtml($notification->getTitle()) ?>
</strong>
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
<p class="notifications-entry-description _cutted">
<span class="notifications-entry-description-start">
<?= /* @escapeNotVerified */ substr($notificationDescription, 0, $notificationDescriptionLength) ?>
</span>
<span class="notifications-entry-description-end">
<?= /* @escapeNotVerified */ substr($notificationDescription, $notificationDescriptionLength) ?>
</span>
</p>
<?php else : ?>
<p class="notifications-entry-description">
<?= /* @escapeNotVerified */ $notificationDescription ?>
</p>
<?php endif; ?>
<time class="notifications-entry-time">
<?= /* @escapeNotVerified */ $block->formatNotificationDate($notification->getDateAdded()) ?>
</time>
<button
type="button"
class="notifications-close"
title="<?= /* @escapeNotVerified */ __('Close') ?>"
></button>
</li>
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox */ ?>
<li class="notifications-entry<?php if ($notification->getSeverity() == 1) : ?> notifications-critical<?php endif; ?>"
data-notification-id="<?= $block->escapeHtmlAttr($notification->getId()) ?>"
data-notification-severity="<?php if ($notification->getSeverity() == 1) : ?>1<?php endif; ?>">
<?php
$notificationDescription = $notification->getDescription();
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
?>
<strong class="notifications-entry-title">
<?= $block->escapeHtml($notification->getTitle()) ?>
</strong>
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
<p class="notifications-entry-description _cutted">
<span class="notifications-entry-description-start">
<?= $block->escapeHtml(substr($notificationDescription, 0, $notificationDescriptionLength)) ?>
</span>
<span class="notifications-entry-description-end">
<?= $block->escapeHtml(substr($notificationDescription, $notificationDescriptionLength)) ?>
</span>
</p>
<?php else : ?>
<p class="notifications-entry-description">
<?= $block->escapeHtml($notificationDescription) ?>
</p>
<?php endif; ?>
<time class="notifications-entry-time">
<?= $block->escapeHtml($block->formatNotificationDate($notification->getDateAdded())) ?>
</time>
<button
type="button"
class="notifications-close"
title="<?= $block->escapeHtmlAttr(__('Close')) ?>"
></button>
</li>
<?php endforeach; ?>
<li class="notifications-entry notifications-entry-last">
<a
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"
class="action-tertiary action-more">
<?= /* @escapeNotVerified */ __('See All (') ?><span class="notifications-counter"><?= /* @escapeNotVerified */ $notificationCount ?></span><?= /* @escapeNotVerified */ __(' unread)') ?>
<?= $block->escapeHtml(__('See All (')) ?><span class="notifications-counter"><?= (int)$notificationCount ?></span><?= $block->escapeHtml(__(' unread)')) ?>
</a>
</li>
</ul>
<?php else : ?>
<a
class="notifications-action admin__action-dropdown"
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/notification/index') ?>"
title="<?= /* @escapeNotVerified */ __('Notifications') ?>">
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"
title="<?= $block->escapeHtmlAttr(__('Notifications')) ?>">
</a>
<?php endif; ?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
namespace Magento\Analytics\Model\ReportXml;

use Magento\Framework\Module\Manager as ModuleManager;
use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager;

/**
* Iterator for ReportXml modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
namespace Magento\Analytics\Test\Unit\Model\ReportXml;

use Magento\Analytics\Model\ReportXml\ModuleIterator;
use Magento\Framework\Module\Manager as ModuleManager;
use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;

/**
* Module iterator test.
*/
class ModuleIteratorTest extends \PHPUnit\Framework\TestCase
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@

use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
use Magento\Framework\Stdlib\ArrayManager;
use Magento\Framework\GraphQL\DataObjectConverter;

/**
* DataProvider Model for Authorizenet
*/
class AuthorizenetDataProvider implements AdditionalDataProviderInterface
{
private const PATH_ADDITIONAL_DATA = 'input/payment_method/additional_data/authorizenet_acceptjs';
private const PATH_ADDITIONAL_DATA = 'authorizenet_acceptjs';

/**
* @var ArrayManager
Expand All @@ -36,12 +35,12 @@ public function __construct(
/**
* Return additional data
*
* @param array $args
* @param array $data
* @return array
*/
public function getData(array $args): array
public function getData(array $data): array
{
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $args) ?? [];
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
foreach ($additionalData as $key => $value) {
$additionalData[$this->snakeCaseToCamelCase($key)] = $value;
unset($additionalData[$key]);
Expand Down
Loading

0 comments on commit 0e59bcf

Please sign in to comment.