From 0fd0b297720393f3108be955b06d9b29ffaa53a9 Mon Sep 17 00:00:00 2001 From: flynsarmy Date: Sat, 13 Sep 2014 17:17:15 +1000 Subject: [PATCH] Correctly sanitize number fields --- modules/backend/widgets/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index fff5cccc0..e2a2362bf 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -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); } -} \ No newline at end of file +}