Skip to content

Commit 657420d

Browse files
authored
Merge branch '2.4-develop' into save-checkout-address
2 parents a54cc96 + 3bcbd95 commit 657420d

File tree

268 files changed

+6472
-862
lines changed

Some content is hidden

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

268 files changed

+6472
-862
lines changed

.github/stale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Configuration for probot-stale - https://github.com/probot/stale
22

33
# Number of days of inactivity before an Issue or Pull Request becomes stale
4-
daysUntilStale: 76
4+
daysUntilStale: 76
55

66
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
77
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
@@ -18,7 +18,7 @@ exemptLabels:
1818
- "Progress: dev in progress"
1919
- "Progress: PR in progress"
2020
- "Progress: done"
21-
- "B2B: GraphQL"
21+
- "B2B: GraphQL"
2222
- "Progress: PR Created"
2323
- "PAP"
2424
- "Project: Login as Customer"

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
* Toolbar entry that shows latest notifications
1111
*
1212
* @api
13-
* @author Magento Core Team <[email protected]>
1413
* @since 100.0.2
1514
*/
1615
class ToolbarEntry extends \Magento\Backend\Block\Template

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/**
1313
* AdminNotification Feed model
1414
*
15-
* @author Magento Core Team <[email protected]>
1615
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1716
* @api
1817
* @since 100.0.2

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/**
99
* AdminNotification Inbox interface
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/**
99
* Notification service model
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/

app/code/Magento/AdminNotification/Model/ResourceModel/Grid/Collection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* AdminNotification Inbox model
9-
*
10-
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\AdminNotification\Model\ResourceModel\Grid;
1311

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* AdminNotification Inbox model
1010
*
1111
* @api
12-
* @author Magento Core Team <[email protected]>
13-
* @api
1412
* @since 100.0.2
1513
*/
1614
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/Unread.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Collection of unread notifications
9-
*
10-
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;
1311

app/code/Magento/AdminNotification/Observer/PredispatchAdminActionControllerObserver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
/**
1111
* AdminNotification observer
12-
*
13-
* @author Magento Core Team <[email protected]>
12+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1413
*/
1514
class PredispatchAdminActionControllerObserver implements ObserverInterface
1615
{

app/code/Magento/AdvancedSearch/Block/Adminhtml/Search/Edit.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Search queries relations grid container
1010
*
1111
* @api
12-
* @author Magento Core Team <[email protected]>
1312
* @since 100.0.2
1413
*/
1514
class Edit extends \Magento\Backend\Block\Widget\Grid\Container

app/code/Magento/AdvancedSearch/Block/Adminhtml/Search/Grid.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Search query relations edit grid
1010
*
1111
* @api
12-
* @author Magento Core Team <[email protected]>
1312
* @since 100.0.2
1413
*/
1514
class Grid extends \Magento\Backend\Block\Widget\Grid

app/code/Magento/AdvancedSearch/Model/ResourceModel/Recommendations.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/**
99
* Catalog search recommendations resource model
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/

app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function _countExpr($expr, $collection)
117117
foreach ($parsedExpression as $operand) {
118118
if ($this->_parser->isOperation($operand)) {
119119
$this->_checkOperandsSet($firstOperand, $secondOperand, $tmpResult, $result);
120-
$result = $this->_operate($firstOperand, $secondOperand, $operand, $tmpResult, $result);
120+
$result = $this->_operate($firstOperand, $secondOperand, $operand);
121121
$firstOperand = $secondOperand = null;
122122
} else {
123123
if (null === $firstOperand) {
@@ -133,9 +133,9 @@ protected function _countExpr($expr, $collection)
133133
/**
134134
* Check if operands in not null and set operands values if they are empty
135135
*
136-
* @param float|int &$firstOperand
137-
* @param float|int &$secondOperand
138-
* @param float|int &$tmpResult
136+
* @param float|int $firstOperand
137+
* @param float|int $secondOperand
138+
* @param float|int $tmpResult
139139
* @param float|int $result
140140
* @return void
141141
*/

app/code/Magento/Backend/Test/Unit/Helper/DataTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ protected function setUp(): void
4242
$this->createMock(Auth::class),
4343
$this->_frontResolverMock,
4444
$this->createMock(Random::class),
45-
$this->getMockForAbstractClass(RequestInterface::class)
4645
);
4746
}
4847

app/code/Magento/Catalog/Block/Product/View/Details.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ class Details extends \Magento\Framework\View\Element\Template
2727
*
2828
* @return array
2929
* @since 103.0.1
30+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3031
*/
3132
public function getGroupSortedChildNames(string $groupName, string $callback): array
3233
{
33-
$groupChildNames = $this->getGroupChildNames($groupName, $callback);
34+
$groupChildNames = $this->getGroupChildNames($groupName);
3435
$layout = $this->getLayout();
3536

3637
$childNamesSortOrder = [];

app/code/Magento/Catalog/Helper/Product/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function initProductLayout(ResultPage $resultPage, $product, $params = nu
193193
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
194194
}
195195
}
196-
196+
197197
$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], null, false);
198198
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]);
199199

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Catalog\Model\Attribute\Backend;
10+
11+
use Magento\Catalog\Model\AbstractModel;
12+
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
13+
use Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend as ParentBackend;
14+
use Magento\Eav\Model\Entity\Attribute\Exception;
15+
use Magento\Framework\DataObject;
16+
use Magento\Framework\Exception\LocalizedException;
17+
use Magento\Framework\Validation\ValidationException;
18+
use Magento\Framework\Validator\HTML\WYSIWYGValidatorInterface;
19+
20+
/**
21+
* Default backend model for catalog attributes.
22+
*/
23+
class DefaultBackend extends ParentBackend
24+
{
25+
/**
26+
* @var WYSIWYGValidatorInterface
27+
*/
28+
private $wysiwygValidator;
29+
30+
/**
31+
* @param WYSIWYGValidatorInterface $wysiwygValidator
32+
*/
33+
public function __construct(WYSIWYGValidatorInterface $wysiwygValidator)
34+
{
35+
$this->wysiwygValidator = $wysiwygValidator;
36+
}
37+
38+
/**
39+
* Validate user HTML value.
40+
*
41+
* @param DataObject $object
42+
* @return void
43+
* @throws LocalizedException
44+
*/
45+
private function validateHtml(DataObject $object): void
46+
{
47+
$attribute = $this->getAttribute();
48+
$code = $attribute->getAttributeCode();
49+
if ($attribute instanceof Attribute && $attribute->getIsHtmlAllowedOnFront()) {
50+
$value = $object->getData($code);
51+
if ($value
52+
&& is_string($value)
53+
&& (!($object instanceof AbstractModel) || $object->getData($code) !== $object->getOrigData($code))
54+
) {
55+
try {
56+
$this->wysiwygValidator->validate($object->getData($code));
57+
} catch (ValidationException $exception) {
58+
$attributeException = new Exception(
59+
__(
60+
'Using restricted HTML elements for "%1". %2',
61+
$attribute->getName(),
62+
$exception->getMessage()
63+
),
64+
$exception
65+
);
66+
$attributeException->setAttributeCode($code)->setPart('backend');
67+
throw $attributeException;
68+
}
69+
}
70+
}
71+
}
72+
73+
/**
74+
* @inheritDoc
75+
*/
76+
public function beforeSave($object)
77+
{
78+
parent::beforeSave($object);
79+
$this->validateHtml($object);
80+
81+
return $this;
82+
}
83+
84+
/**
85+
* @inheritDoc
86+
*/
87+
public function validate($object)
88+
{
89+
$isValid = parent::validate($object);
90+
if ($isValid) {
91+
$this->validateHtml($object);
92+
}
93+
94+
return $isValid;
95+
}
96+
}

0 commit comments

Comments
 (0)