Skip to content

Commit 04e5a42

Browse files
authored
Strlen callback function
This PR is similar to #4083. It replaces the callback function '\strlen' with an arrow function (introduced in PHP 7.4) to avoid the error message bellow starting with PHP >8.1 Deprecated functionality: strlen(): Passing null to parameter #1
1 parent ced031d commit 04e5a42

File tree

1 file changed

+1
-1
lines changed
  • app/code/core/Mage/ImportExport/Model/Import/Entity

1 file changed

+1
-1
lines changed

app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,7 @@ protected function _saveStockItem()
19721972
*/
19731973
protected function _filterRowData(&$rowData)
19741974
{
1975-
$rowData = array_filter($rowData, '\strlen');
1975+
$rowData = array_filter($rowData, fn ($tmpString) => strlen($tmpString ?? ''));
19761976
// Exceptions - for sku - put them back in
19771977
if (!isset($rowData[self::COL_SKU])) {
19781978
$rowData[self::COL_SKU] = null;

0 commit comments

Comments
 (0)