Index: trunk/core/kernel/utility/formatters/formatter.php =================================================================== diff -u -N -r7391 -r7635 --- trunk/core/kernel/utility/formatters/formatter.php (.../formatter.php) (revision 7391) +++ trunk/core/kernel/utility/formatters/formatter.php (.../formatter.php) (revision 7635) @@ -18,7 +18,13 @@ { $field_type = $options['type']; $type_ok = preg_match('#int|integer|double|float|real|numeric|string#', $field_type); - if($field_type == 'string') return $value; + if ($field_type == 'string') { + if (!$this->Application->IsAdmin() && isset($options['allow_html']) && $options['allow_html']) { + // this allows to revert htmlspecialchars call for each field submitted on front-end + $value = unhtmlentities($value); + } + return $value; + } static $comma = null; static $thousands = null; @@ -46,6 +52,19 @@ return $ret ? $value : false; } + function TypeCastArray($src, &$object) + { + $dst = array(); + foreach ($src as $id => $row) { + $tmp_row = array(); + foreach ($row as $fld => $value) { + $tmp_row[$fld] = $this->TypeCast($value, $object->Fields[$fld]); + } + $dst[$id] = $tmp_row; + } + return $dst; + } + //function Format($value, $options, &$errors) function Format($value, $field_name, &$object, $format=null) {