Correctly sanitize number fields

This commit is contained in:
flynsarmy 2014-09-13 17:17:15 +10:00
parent e63a083ca2
commit 0fd0b29772
1 changed files with 2 additions and 2 deletions

View File

@ -706,7 +706,7 @@ class Form extends WidgetBase
$columnParts = Str::evalHtmlArray($field->columnName);
$columnDotted = implode('.', $columnParts);
$columnValue = array_get($data, $columnDotted, 0);
if ($field->type == 'number') $columnValue = (int) $columnValue;
if ($field->type == 'number') $columnValue = (float) $columnValue;
array_set($data, $columnDotted, $columnValue);
}
@ -801,4 +801,4 @@ class Form extends WidgetBase
return method_exists($object, $method);
}
}
}