Index: branches/5.2.x/core/kernel/utility/formatters/upload_formatter.php =================================================================== diff -u -N -r15137 -r15345 --- branches/5.2.x/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 15137) +++ branches/5.2.x/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 15345) @@ -1,6 +1,6 @@ Application->isAdmin ) { + // this allows to revert htmlspecialchars call for each field submitted on front-end + $value = is_array($value) ? array_map('htmlspecialchars_decode', $value) : htmlspecialchars_decode($value); + } + $ret = !is_array($value) ? $value : ''; $options = $object->GetFieldOptions($field_name); @@ -76,22 +81,26 @@ // no pending files -> return already uploded files return getArrayValue($value, 'upload'); } + $swf_uploaded_ids = explode('|', $value['tmp_ids']); $swf_uploaded_names = explode('|', $value['tmp_names']); $existing = $value['upload'] ? explode('|', $value['upload']) : array(); + if (isset($options['multiple'])) { $max_files = $options['multiple'] == false ? 1 : $options['multiple']; } else { $max_files = 1; } + $fret = array(); // don't delete uploaded file, when it's name matches delete file name $var_name = $object->getPrefixSpecial().'_file_pending_actions'.$this->Application->GetVar('m_wid'); $schedule = $this->Application->RecallVar($var_name); $schedule = $schedule ? unserialize($schedule) : Array(); $files2delete = Array(); + foreach ($schedule as $data) { if ($data['action'] == 'delete') { $files2delete[] = $data['file']; @@ -258,7 +267,7 @@ * @param string $format * @return string */ - function Format($value, $field_name, &$object, $format = null) + function Format($value, $field_name, &$object, $format = NULL) { if (is_null($value)) { return ''; @@ -303,7 +312,7 @@ * @param bool $force_direct_links * @return string */ - function GetFormatted($value, $field_name, &$object, $format = null, $force_direct_links = null) + function GetFormatted($value, $field_name, &$object, $format = NULL, $force_direct_links = NULL) { if (!$format) { return $value;