Index: trunk/core/kernel/utility/formatters/formatter.php =================================================================== diff -u -N -r7635 -r8842 --- trunk/core/kernel/utility/formatters/formatter.php (.../formatter.php) (revision 7635) +++ trunk/core/kernel/utility/formatters/formatter.php (.../formatter.php) (revision 8842) @@ -87,7 +87,14 @@ return $tc_value; } -//function Parse($value, $options, &$errors) + /** + * Performs basic type validation on form field value + * + * @param mixed $value + * @param string $field_name + * @param kDBItem $object + * @return mixed + */ function Parse($value, $field_name, &$object) { if ($value == '') return NULL; @@ -96,16 +103,15 @@ $tc_value = $this->TypeCast($value,$options); if($tc_value === false) return $value; // for leaving badly formatted date on the form - if( isset($options['type']) ) - { - if( preg_match('#double|float|real|numeric#', $options['type']) ) $tc_value = str_replace(',', '.', $tc_value); + if(isset($options['type'])) { + if (preg_match('#double|float|real|numeric#', $options['type'])) { + $tc_value = str_replace(',', '.', $tc_value); + } } - if( isset($options['regexp']) ) - { - if( !preg_match($options['regexp'], $value) ) - { - $object->FieldErrors[$field_name]['pseudo'] = 'invalid_format'; + if (isset($options['regexp'])) { + if (!preg_match($options['regexp'], $value)) { + $object->SetError($field_name, 'invalid_format'); } }