import: strip separator for int

This commit is contained in:
Yuri Kuznetsov
2023-11-16 15:01:31 +02:00
parent 4d8784470b
commit afdc874df9
+8 -1
View File
@@ -991,7 +991,14 @@ class Import
return floatval($left);
case Entity::INT:
if (!is_numeric($value)) {
$replaceList = [
' ',
$decimalMark === '.' ? ',' : '.',
];
$value = str_replace($replaceList, '', $value);
if (str_contains($value, $decimalMark) || !is_numeric($value)) {
throw ValidationError::create(
new Failure($entity->getEntityType(), $attribute, 'valid')
);