Skip to content

Commit 4f4cf01

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into ACPT-672
2 parents fdee720 + 5dd75c7 commit 4f4cf01

File tree

60 files changed

+1786
-440
lines changed

Some content is hidden

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

60 files changed

+1786
-440
lines changed

app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Backend\Controller\Adminhtml\System\Design;
88

99
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
use Magento\Framework\Filter\FilterInput;
1011

1112
/**
1213
* Save design action.
@@ -21,13 +22,13 @@ class Save extends \Magento\Backend\Controller\Adminhtml\System\Design implement
2122
*/
2223
protected function _filterPostData($data)
2324
{
24-
$inputFilter = new \Zend_Filter_Input(
25+
$inputFilter = new FilterInput(
2526
['date_from' => $this->dateFilter, 'date_to' => $this->dateFilter],
2627
[],
2728
$data
2829
);
29-
$data = $inputFilter->getUnescaped();
30-
return $data;
30+
31+
return $inputFilter->getUnescaped();
3132
}
3233

3334
/**

app/code/Magento/Catalog/Controller/Adminhtml/Category.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Catalog\Controller\Adminhtml;
99

1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Filter\FilterInput;
1112
use Magento\Store\Model\Store;
1213
use Magento\Framework\Controller\ResultFactory;
1314

@@ -22,7 +23,7 @@ abstract class Category extends \Magento\Backend\App\Action
2223
*
2324
* @see _isAllowed()
2425
*/
25-
const ADMIN_RESOURCE = 'Magento_Catalog::categories';
26+
public const ADMIN_RESOURCE = 'Magento_Catalog::categories';
2627

2728
/**
2829
* @var \Magento\Framework\Stdlib\DateTime\Filter\Date
@@ -154,6 +155,7 @@ private function resolveStoreId() : int
154155
* @return \Magento\Framework\Controller\Result\Json
155156
*
156157
* @deprecated 101.0.0
158+
* @see we don't recommend this approach anymore
157159
*/
158160
protected function ajaxRequestResponse($category, $resultPage)
159161
{
@@ -213,7 +215,7 @@ protected function dateTimePreprocessing($category, $postData)
213215
}
214216
}
215217
}
216-
$inputFilter = new \Zend_Filter_Input($dateFieldFilters, [], $postData);
218+
$inputFilter = new FilterInput($dateFieldFilters, [], $postData);
217219
return $inputFilter->getUnescaped();
218220
}
219221
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Magento\Framework\Locale\FormatInterface;
2626
use Magento\Framework\Stdlib\DateTime\Filter\Date;
2727
use Magento\Store\Model\StoreManagerInterface;
28-
use Zend_Filter_Input;
28+
use Magento\Framework\Filter\FilterInput;
2929

3030
/**
3131
* Product helper
@@ -60,6 +60,7 @@ class Helper
6060
/**
6161
* @var Date
6262
* @deprecated 101.0.0
63+
* @see we don't recommend this approach anymore
6364
*/
6465
protected $dateFilter;
6566

@@ -250,7 +251,7 @@ public function initializeFromData(Product $product, array $productData)
250251
}
251252
}
252253

253-
$inputFilter = new Zend_Filter_Input($dateFieldFilters, [], $productData);
254+
$inputFilter = new FilterInput($dateFieldFilters, [], $productData);
254255
$productData = $inputFilter->getUnescaped();
255256

256257
if (isset($productData['options'])) {
@@ -435,6 +436,7 @@ private function overwriteValue($optionId, $option, $overwriteOptions)
435436
*
436437
* @return LinkResolver
437438
* @deprecated 102.0.0
439+
* @see we don't recommend this approach anymore
438440
*/
439441
private function getLinkResolver()
440442
{

app/code/Magento/Catalog/Model/Product/Filter/DateTime.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77

88
namespace Magento\Catalog\Model\Product\Filter;
99

10+
use Laminas\Filter\FilterInterface;
1011
use Magento\Framework\Stdlib\DateTime as StdlibDateTime;
1112
use Magento\Framework\Stdlib\DateTime\Filter\DateTime as StdlibDateTimeFilter;
1213

1314
/**
1415
* Product datetime fields values filter
1516
*/
16-
class DateTime implements \Zend_Filter_Interface
17+
class DateTime implements FilterInterface
1718
{
1819
/**
1920
* @var StdlibDateTimeFilter

app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
*/
77
namespace Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog;
88

9-
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
109
use Magento\Backend\App\Action\Context;
10+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
11+
use Magento\Framework\App\Request\DataPersistorInterface;
1112
use Magento\Framework\Exception\LocalizedException;
13+
use Magento\Framework\Filter\FilterInput;
1214
use Magento\Framework\Registry;
1315
use Magento\Framework\Stdlib\DateTime\Filter\Date;
14-
use Magento\Framework\App\Request\DataPersistorInterface;
1516
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1617

1718
/**
@@ -80,7 +81,7 @@ public function execute()
8081
if ($this->getRequest()->getParam('to_date')) {
8182
$filterValues['to_date'] = $this->_dateFilter;
8283
}
83-
$inputFilter = new \Zend_Filter_Input(
84+
$inputFilter = new FilterInput(
8485
$filterValues,
8586
[],
8687
$data
@@ -146,8 +147,9 @@ public function execute()
146147
__('Something went wrong while saving the rule data. Please review the error log.')
147148
);
148149
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
149-
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setPageData($data);
150-
$this->dataPersistor->set('catalog_rule', $data);
150+
$ruleData = $data ?? $this->getRequest()->getPostValue();
151+
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setPageData($ruleData);
152+
$this->dataPersistor->set('catalog_rule', $ruleData);
151153
$this->_redirect('catalog_rule/*/edit', ['id' => $this->getRequest()->getParam('rule_id')]);
152154
return;
153155
}

app/code/Magento/Checkout/Controller/Cart/Add.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\App\ResponseInterface;
1515
use Magento\Framework\Controller\ResultInterface;
1616
use Magento\Framework\Exception\NoSuchEntityException;
17+
use Magento\Framework\Filter\LocalizedToNormalized;
1718

1819
/**
1920
* Controller for processing add to cart action.
@@ -105,7 +106,7 @@ public function execute()
105106
$params = $this->getRequest()->getParams();
106107
try {
107108
if (isset($params['qty'])) {
108-
$filter = new \Zend_Filter_LocalizedToNormalized(
109+
$filter = new LocalizedToNormalized(
109110
['locale' => $this->_objectManager->get(
110111
\Magento\Framework\Locale\ResolverInterface::class
111112
)->getLocale()]

app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Controller\Result\Redirect;
1313
use Magento\Framework\DataObject;
1414
use Magento\Framework\Exception\LocalizedException;
15+
use Magento\Framework\Filter\LocalizedToNormalized;
1516
use Magento\Framework\Locale\ResolverInterface;
1617
use Psr\Log\LoggerInterface;
1718

@@ -37,7 +38,7 @@ public function execute()
3738
}
3839
try {
3940
if (isset($params['qty'])) {
40-
$inputFilter = new \Zend_Filter_LocalizedToNormalized(
41+
$inputFilter = new LocalizedToNormalized(
4142
[
4243
'locale' => $this->_objectManager->get(ResolverInterface::class)->getLocale(),
4344
]

app/code/Magento/Checkout/Model/Sidebar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
use Magento\Checkout\Helper\Data as HelperData;
99
use Magento\Checkout\Model\Cart;
1010
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\Filter\LocalizedToNormalized;
1112
use Magento\Framework\Locale\ResolverInterface;
1213
use Magento\Quote\Api\Data\CartItemInterface;
1314
use Magento\Quote\Model\Quote\Address\Total;
1415

1516
/**
1617
* @deprecated 100.1.0
18+
* @see we don't recommend this approach anymore
1719
*/
1820
class Sidebar
1921
{
@@ -127,7 +129,7 @@ public function updateQuoteItem($itemId, $itemQty)
127129
protected function normalize($itemQty)
128130
{
129131
if ($itemQty) {
130-
$filter = new \Zend_Filter_LocalizedToNormalized(
132+
$filter = new LocalizedToNormalized(
131133
['locale' => $this->resolver->getLocale()]
132134
);
133135
return $filter->filter((string)$itemQty);

app/code/Magento/Cms/Controller/Adminhtml/Page/PostDataProcessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\Config\Dom\ValidationException;
1212
use Magento\Framework\Config\Dom\ValidationSchemaException;
1313
use Magento\Cms\Model\Page\CustomLayout\CustomLayoutValidator;
14+
use Magento\Framework\Filter\FilterInput;
1415

1516
/**
1617
* Controller helper for user input.
@@ -81,15 +82,16 @@ public function filter($data)
8182
}
8283
}
8384

84-
return (new \Zend_Filter_Input($filterRules, [], $data))->getUnescaped();
85+
return (new FilterInput($filterRules, [], $data))->getUnescaped();
8586
}
8687

8788
/**
8889
* Validate post data
8990
*
9091
* @param array $data
91-
* @return bool Return FALSE if some item is invalid
92+
* @return bool Return FALSE if some item is invalid
9293
* @deprecated 103.0.2
94+
* @see no alternatives
9395
*/
9496
public function validate($data)
9597
{
@@ -159,9 +161,7 @@ private function validateData($data, $layoutXmlValidator)
159161
if (!$this->customLayoutValidator->validate($data)) {
160162
return false;
161163
}
162-
} catch (ValidationException $e) {
163-
return false;
164-
} catch (ValidationSchemaException $e) {
164+
} catch (ValidationException | ValidationSchemaException $e) {
165165
return false;
166166
} catch (\Exception $e) {
167167
$this->messageManager->addExceptionMessage($e);

app/code/Magento/Directory/Model/Currency/Filter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
*/
1010
namespace Magento\Directory\Model\Currency;
1111

12+
use Laminas\Filter\FilterInterface;
1213
use Magento\Framework\Pricing\PriceCurrencyInterface;
1314

14-
class Filter implements \Zend_Filter_Interface
15+
class Filter implements FilterInterface
1516
{
1617
/**
1718
* Rate value
@@ -43,8 +44,6 @@ class Filter implements \Zend_Filter_Interface
4344
protected $_localeCurrency;
4445

4546
/**
46-
* Price currency
47-
*
4847
* @var PriceCurrencyInterface
4948
*/
5049
protected $priceCurrency;

0 commit comments

Comments
 (0)