Skip to content

Commit 4d3a004

Browse files
authored
Merge branch 'magento-commerce:2.4-develop' into MC-39920
2 parents a722ffa + c4003e8 commit 4d3a004

File tree

17 files changed

+2706
-2393
lines changed

17 files changed

+2706
-2393
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,15 @@ public function isAttributeValid($attrCode, array $attrParams, array $rowData)
205205
return $valid;
206206
}
207207

208-
if (!strlen(trim($rowData[$attrCode]))) {
208+
if ($rowData[$attrCode] === null || trim($rowData[$attrCode]) === '') {
209209
return true;
210210
}
211211

212212
if ($rowData[$attrCode] === $this->context->getEmptyAttributeValueConstant() && !$attrParams['is_required']) {
213213
return true;
214214
}
215215

216+
$valid = false;
216217
switch ($attrParams['type']) {
217218
case 'varchar':
218219
case 'text':

app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfo.php

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,29 @@ class PersonalInfo extends \Magento\Backend\Block\Template
2323
* since his last activity. Used only if it's impossible to get such setting
2424
* from configuration.
2525
*/
26-
const DEFAULT_ONLINE_MINUTES_INTERVAL = 15;
26+
public const DEFAULT_ONLINE_MINUTES_INTERVAL = 15;
2727

2828
/**
29-
* Customer
30-
*
3129
* @var \Magento\Customer\Api\Data\CustomerInterface
3230
*/
3331
protected $customer;
3432

3533
/**
36-
* Customer log
37-
*
3834
* @var \Magento\Customer\Model\Log
3935
*/
4036
protected $customerLog;
4137

4238
/**
43-
* Customer logger
44-
*
4539
* @var \Magento\Customer\Model\Logger
4640
*/
4741
protected $customerLogger;
4842

4943
/**
50-
* Customer registry
51-
*
5244
* @var \Magento\Customer\Model\CustomerRegistry
5345
*/
5446
protected $customerRegistry;
5547

5648
/**
57-
* Account management
58-
*
5949
* @var AccountManagementInterface
6050
*/
6151
protected $accountManagement;
@@ -68,43 +58,31 @@ class PersonalInfo extends \Magento\Backend\Block\Template
6858
protected $groupRepository;
6959

7060
/**
71-
* Customer data factory
72-
*
7361
* @var \Magento\Customer\Api\Data\CustomerInterfaceFactory
7462
*/
7563
protected $customerDataFactory;
7664

7765
/**
78-
* Address helper
79-
*
8066
* @var \Magento\Customer\Helper\Address
8167
*/
8268
protected $addressHelper;
8369

8470
/**
85-
* Date time
86-
*
8771
* @var \Magento\Framework\Stdlib\DateTime
8872
*/
8973
protected $dateTime;
9074

9175
/**
92-
* Core registry
93-
*
9476
* @var \Magento\Framework\Registry
9577
*/
9678
protected $coreRegistry;
9779

9880
/**
99-
* Address mapper
100-
*
10181
* @var Mapper
10282
*/
10383
protected $addressMapper;
10484

10585
/**
106-
* Data object helper
107-
*
10886
* @var \Magento\Framework\Api\DataObjectHelper
10987
*/
11088
protected $dataObjectHelper;
@@ -439,7 +417,8 @@ public function getLastLoginDate()
439417
*/
440418
public function getStoreLastLoginDate()
441419
{
442-
$date = strtotime($this->getCustomerLog()->getLastLoginAt());
420+
$lastLogin = $this->getCustomerLog()->getLastLoginAt();
421+
$date = $lastLogin !== null ? strtotime($lastLogin) : false;
443422

444423
if ($date) {
445424
$date = $this->_localeDate->scopeDate($this->getCustomer()->getStoreId(), $date, true);

app/code/Magento/Customer/Model/Options.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getNamePrefixOptions($store = null)
4949
{
5050
return $this->prepareNamePrefixSuffixOptions(
5151
$this->addressHelper->getConfig('prefix_options', $store),
52-
$this->addressHelper->getConfig('prefix_show', $store) == NooptreqSource::VALUE_OPTIONAL
52+
$this->addressHelper->getConfig('prefix_show', $store) === NooptreqSource::VALUE_OPTIONAL
5353
);
5454
}
5555

@@ -63,7 +63,7 @@ public function getNameSuffixOptions($store = null)
6363
{
6464
return $this->prepareNamePrefixSuffixOptions(
6565
$this->addressHelper->getConfig('suffix_options', $store),
66-
$this->addressHelper->getConfig('suffix_show', $store) == NooptreqSource::VALUE_OPTIONAL
66+
$this->addressHelper->getConfig('suffix_show', $store) === NooptreqSource::VALUE_OPTIONAL
6767
);
6868
}
6969

@@ -93,13 +93,12 @@ protected function _prepareNamePrefixSuffixOptions($options, $isOptional = false
9393
*/
9494
private function prepareNamePrefixSuffixOptions($options, $isOptional = false)
9595
{
96-
$options = trim($options);
97-
if (empty($options)) {
96+
if ($options === null || empty(trim($options))) {
9897
return false;
9998
}
100-
10199
$result = [];
102-
$options = explode(';', $options);
100+
$options = explode(';', trim($options));
101+
103102
foreach ($options as $value) {
104103
$result[] = $this->escaper->escapeHtml(trim($value)) ?: ' ';
105104
}

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,12 @@ public function setRequest(\Magento\Framework\DataObject $request)
482482
);
483483

484484
$shippingWeight = $request->getPackageWeight();
485+
$destStreet = $request->getDestStreet() !== null ? str_replace("\n", '', $request->getDestStreet()) : '';
485486

486487
$requestObject->setValue(sprintf('%.2f', $request->getPackageValue()))
487488
->setValueWithDiscount($request->getPackageValueWithDiscount())
488489
->setCustomsValue($request->getPackageCustomsValue())
489-
->setDestStreet($this->string->substr(str_replace("\n", '', $request->getDestStreet()), 0, 35))
490+
->setDestStreet($this->string->substr($destStreet, 0, 35))
490491
->setDestStreetLine2($request->getDestStreetLine2())
491492
->setDestCity($request->getDestCity())
492493
->setOrigCompanyName($request->getOrigCompanyName())
@@ -939,7 +940,7 @@ protected function _getDimension($dimension, $configWeightUnit = false)
939940
);
940941
}
941942

942-
return round($dimension, 3);
943+
return round((float) $dimension, 3);
943944
}
944945

945946
/**

app/code/Magento/Elasticsearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"magento/module-store": "*",
1313
"magento/module-catalog-inventory": "*",
1414
"magento/framework": "*",
15-
"elasticsearch/elasticsearch": "~7.15.0"
15+
"elasticsearch/elasticsearch": "~7.16.0"
1616
},
1717
"suggest": {
1818
"magento/module-config": "*"

app/code/Magento/Elasticsearch6/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/module-catalog-search": "*",
99
"magento/module-search": "*",
1010
"magento/module-elasticsearch": "*",
11-
"elasticsearch/elasticsearch": "~7.15.0"
11+
"elasticsearch/elasticsearch": "~7.16.0"
1212
},
1313
"suggest": {
1414
"magento/module-config": "*"

app/code/Magento/Elasticsearch7/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"php": "~7.4.0||~8.0.0",
66
"magento/framework": "*",
77
"magento/module-elasticsearch": "*",
8-
"elasticsearch/elasticsearch": "~7.15.0",
8+
"elasticsearch/elasticsearch": "~7.16.0",
99
"magento/module-advanced-search": "*",
1010
"magento/module-catalog-search": "*"
1111
},

app/code/Magento/GoogleAnalytics/Block/Ga.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
class Ga extends \Magento\Framework\View\Element\Template
1818
{
1919
/**
20-
* Google analytics data
21-
*
2220
* @var \Magento\GoogleAnalytics\Helper\Data
2321
*/
2422
protected $_googleAnalyticsData = null;
@@ -261,8 +259,8 @@ public function getOrdersTrackingData()
261259
private function getOptPageUrl()
262260
{
263261
$optPageURL = '';
264-
$pageName = trim($this->getPageName());
265-
if ($pageName && substr($pageName, 0, 1) == '/' && strlen($pageName) > 1) {
262+
$pageName = $this->getPageName() !== null ? trim($this->getPageName()) : '';
263+
if ($pageName && substr($pageName, 0, 1) === '/' && strlen($pageName) > 1) {
266264
$optPageURL = ", '" . $this->escapeHtmlAttr($pageName, false) . "'";
267265
}
268266
return $optPageURL;

app/code/Magento/Payment/Model/Method/Cc.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ public function assignData(\Magento\Framework\DataObject $data)
286286
[
287287
'cc_type' => $additionalData->getCcType(),
288288
'cc_owner' => $additionalData->getCcOwner(),
289-
'cc_last_4' => substr($additionalData->getCcNumber(), -4),
289+
'cc_last_4' => $additionalData->getCcNumber() !== null ?
290+
substr($additionalData->getCcNumber(), -4) : '',
290291
'cc_number' => $additionalData->getCcNumber(),
291292
'cc_cid' => $additionalData->getCcCid(),
292293
'cc_exp_month' => $additionalData->getCcExpMonth(),
@@ -323,8 +324,9 @@ public function validateCcNum($ccNumber)
323324
{
324325
$cardNumber = strrev($ccNumber);
325326
$numSum = 0;
327+
$length = strlen($cardNumber);
326328

327-
for ($i = 0; $i < strlen($cardNumber); $i++) {
329+
for ($i = 0; $i < $length; $i++) {
328330
$currentNum = substr($cardNumber, $i, 1);
329331

330332
/**

app/code/Magento/Reports/Block/Adminhtml/Config/Form/Field/YtdStart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function _getElementHtml(AbstractElement $element)
2424
{
2525
$_months = [];
2626
for ($i = 1; $i <= 12; $i++) {
27-
$month = $this->_localeDate->date(mktime(null, null, null, $i, 1))
27+
$month = $this->_localeDate->date(mktime(0, 0, 0, $i, 1))
2828
->format('m');
2929
$_months[$month] = $month;
3030
}

0 commit comments

Comments
 (0)