Skip to content

Commit f39080e

Browse files
authored
Merge pull request #9972 from magento-gl/commpr-10131-2907
[Bluetooth] Community Pull Requests Dashboard Delivery - JulyV2
2 parents edee5b1 + bfce838 commit f39080e

File tree

5 files changed

+41
-48
lines changed

5 files changed

+41
-48
lines changed

app/code/Magento/CheckoutAgreements/Model/Agreement.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99

1010
class Agreement extends \Magento\Framework\Model\AbstractExtensibleModel implements AgreementInterface
1111
{
12+
/**
13+
* @var string
14+
*/
15+
protected $_eventPrefix = 'checkout_agreement';
16+
17+
/**
18+
* @var string
19+
*/
20+
protected $_eventObject = 'agreement';
21+
1222
/**
1323
* Allowed CSS units for height field
1424
*
@@ -17,6 +27,8 @@ class Agreement extends \Magento\Framework\Model\AbstractExtensibleModel impleme
1727
protected $allowedCssUnits = ['px', 'pc', 'pt', 'ex', 'em', 'mm', 'cm', 'in', '%'];
1828

1929
/**
30+
* Agreement constructor
31+
*
2032
* @return void
2133
* @codeCoverageIgnore
2234
*/
@@ -26,6 +38,8 @@ protected function _construct()
2638
}
2739

2840
/**
41+
* Validate agreement data
42+
*
2943
* @param \Magento\Framework\DataObject $agreementData
3044
* @return array|bool
3145
*/
@@ -195,7 +209,7 @@ public function setMode($mode)
195209
}
196210

197211
/**
198-
* {@inheritdoc}
212+
* @inheritdoc
199213
*
200214
* @return \Magento\CheckoutAgreements\Api\Data\AgreementExtensionInterface|null
201215
*/
@@ -205,7 +219,7 @@ public function getExtensionAttributes()
205219
}
206220

207221
/**
208-
* {@inheritdoc}
222+
* @inheritdoc
209223
*
210224
* @param \Magento\CheckoutAgreements\Api\Data\AgreementExtensionInterface $extensionAttributes
211225
* @return $this

app/code/Magento/Cms/Ui/Component/Listing/Column/BlockActions.php

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,19 @@ class BlockActions extends Column
4040
* @param UrlInterface $urlBuilder
4141
* @param array $components
4242
* @param array $data
43+
* @param Escaper|null $escaper
4344
*/
4445
public function __construct(
4546
ContextInterface $context,
4647
UiComponentFactory $uiComponentFactory,
4748
UrlInterface $urlBuilder,
4849
array $components = [],
49-
array $data = []
50+
array $data = [],
51+
?Escaper $escaper = null
5052
) {
5153
$this->urlBuilder = $urlBuilder;
5254
parent::__construct($context, $uiComponentFactory, $components, $data);
55+
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
5356
}
5457

5558
/**
@@ -60,7 +63,7 @@ public function prepareDataSource(array $dataSource)
6063
if (isset($dataSource['data']['items'])) {
6164
foreach ($dataSource['data']['items'] as & $item) {
6265
if (isset($item['block_id'])) {
63-
$title = $this->getEscaper()->escapeHtmlAttr($item['title']);
66+
$title = $this->escaper->escapeHtmlAttr($item['title']);
6467
$item[$this->getData('name')] = [
6568
'edit' => [
6669
'href' => $this->urlBuilder->getUrl(
@@ -92,19 +95,4 @@ public function prepareDataSource(array $dataSource)
9295

9396
return $dataSource;
9497
}
95-
96-
/**
97-
* Get instance of escaper
98-
*
99-
* @return Escaper
100-
* @deprecated 101.0.7
101-
*/
102-
private function getEscaper()
103-
{
104-
if (!$this->escaper) {
105-
// phpcs:ignore Magento2.PHP.AutogeneratedClassNotInConstructor
106-
$this->escaper = ObjectManager::getInstance()->get(Escaper::class);
107-
}
108-
return $this->escaper;
109-
}
11098
}

app/code/Magento/Cms/Ui/Component/Listing/Column/PageActions.php

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
class PageActions extends Column
2020
{
2121
/** Url path */
22-
const CMS_URL_PATH_EDIT = 'cms/page/edit';
23-
const CMS_URL_PATH_DELETE = 'cms/page/delete';
22+
public const CMS_URL_PATH_EDIT = 'cms/page/edit';
23+
public const CMS_URL_PATH_DELETE = 'cms/page/delete';
2424

2525
/**
2626
* @var \Magento\Cms\Block\Adminhtml\Page\Grid\Renderer\Action\UrlBuilder
@@ -56,6 +56,7 @@ class PageActions extends Column
5656
* @param array $data
5757
* @param string $editUrl
5858
* @param \Magento\Cms\ViewModel\Page\Grid\UrlBuilder|null $scopeUrlBuilder
59+
* @param Escaper|null $escaper
5960
*/
6061
public function __construct(
6162
ContextInterface $context,
@@ -65,14 +66,16 @@ public function __construct(
6566
array $components = [],
6667
array $data = [],
6768
$editUrl = self::CMS_URL_PATH_EDIT,
68-
?\Magento\Cms\ViewModel\Page\Grid\UrlBuilder $scopeUrlBuilder = null
69+
?\Magento\Cms\ViewModel\Page\Grid\UrlBuilder $scopeUrlBuilder = null,
70+
?Escaper $escaper = null
6971
) {
7072
$this->urlBuilder = $urlBuilder;
7173
$this->actionUrlBuilder = $actionUrlBuilder;
7274
$this->editUrl = $editUrl;
7375
parent::__construct($context, $uiComponentFactory, $components, $data);
7476
$this->scopeUrlBuilder = $scopeUrlBuilder ?: ObjectManager::getInstance()
7577
->get(\Magento\Cms\ViewModel\Page\Grid\UrlBuilder::class);
78+
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
7679
}
7780

7881
/**
@@ -88,7 +91,7 @@ public function prepareDataSource(array $dataSource)
8891
'href' => $this->urlBuilder->getUrl($this->editUrl, ['page_id' => $item['page_id']]),
8992
'label' => __('Edit'),
9093
];
91-
$title = $this->getEscaper()->escapeHtml($item['title']);
94+
$title = $this->escaper->escapeHtml($item['title']);
9295
$item[$name]['delete'] = [
9396
'href' => $this->urlBuilder->getUrl(self::CMS_URL_PATH_DELETE, ['page_id' => $item['page_id']]),
9497
'label' => __('Delete'),
@@ -115,18 +118,4 @@ public function prepareDataSource(array $dataSource)
115118

116119
return $dataSource;
117120
}
118-
119-
/**
120-
* Get instance of escaper
121-
*
122-
* @return Escaper
123-
* @deprecated 101.0.7
124-
*/
125-
private function getEscaper()
126-
{
127-
if (!$this->escaper) {
128-
$this->escaper = ObjectManager::getInstance()->get(Escaper::class);
129-
}
130-
return $this->escaper;
131-
}
132121
}

app/code/Magento/Eav/Model/AttributeManagement.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Eav\Model;
@@ -92,7 +92,7 @@ public function __construct(
9292
}
9393

9494
/**
95-
* {@inheritdoc}
95+
* @inheritdoc
9696
*/
9797
public function assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder)
9898
{
@@ -134,7 +134,7 @@ public function assign($entityTypeCode, $attributeSetId, $attributeGroupId, $att
134134
}
135135

136136
/**
137-
* {@inheritdoc}
137+
* @inheritdoc
138138
*/
139139
public function unassign($attributeSetId, $attributeCode)
140140
{
@@ -171,13 +171,13 @@ public function unassign($attributeSetId, $attributeCode)
171171
}
172172

173173
/**
174-
* {@inheritdoc}
174+
* @inheritdoc
175175
*/
176-
public function getAttributes($entityType, $attributeSetId)
176+
public function getAttributes($entityTypeCode, $attributeSetId)
177177
{
178178
/** @var \Magento\Eav\Api\Data\AttributeSetInterface $attributeSet */
179179
$attributeSet = $this->setRepository->get($attributeSetId);
180-
$requiredEntityTypeId = $this->eavConfig->getEntityType($entityType)->getId();
180+
$requiredEntityTypeId = $this->eavConfig->getEntityType($entityTypeCode)->getId();
181181
if (!$attributeSet->getAttributeSetId() || $attributeSet->getEntityTypeId() != $requiredEntityTypeId) {
182182
throw NoSuchEntityException::singleField('attributeSetId', $attributeSetId);
183183
}

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2014 Adobe
3+
* All Rights Reserved.
44
*/
55
/* eslint-disable no-useless-escape */
66
// jscs:disable no-useless-escape
77
/**
88
* @api
99
*/
10+
11+
/* eslint-disable no-useless-escape */
1012
define([
1113
'jquery',
1214
'underscore',
@@ -893,11 +895,11 @@ define([
893895
if (utils.isEmpty(value)) {
894896
return true;
895897
}
896-
validRegexp = /^[a-z0-9\._-]{1,30}@([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/i;
898+
validRegexp = /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i; //eslint-disable-line max-len
897899
emails = value.split(/[\s\n\,]+/g);
898900

899901
for (i = 0; i < emails.length; i++) {
900-
if (!validRegexp.test(emails[i].strip())) {
902+
if (!validRegexp.test(emails[i].trim())) {
901903
return false;
902904
}
903905
}

0 commit comments

Comments
 (0)