diff --git a/etemplate/inc/class.vfs_widget.inc.php b/etemplate/inc/class.vfs_widget.inc.php index ef33ea71ff..93e1cda408 100644 --- a/etemplate/inc/class.vfs_widget.inc.php +++ b/etemplate/inc/class.vfs_widget.inc.php @@ -72,6 +72,7 @@ class vfs_widget */ function pre_process($form_name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl) { + //echo "
".__METHOD__."($form_name,$value,".array2string($cell).",...)
\n"; $type = $cell['type']; if ($type != 'vfs-upload') $cell['readonly'] = true; // to not call post-process @@ -89,8 +90,11 @@ class vfs_widget switch($type) { - case 'vfs-upload': // option: allowed mime types (regular expression) if limited - if(empty($value)) $value = $cell['name']; // if no value via content array, use widget name + case 'vfs-upload': // option: allowed mime types (regular expression) if limited + if (empty($value) && preg_match('/^exec.*\[([^]]+)\]$/',$form_name,$matches)) // if no value via content array, use widget name + { + $value = $matches[1].$matches[2]; + } $extension_data = array('value' => $value, 'mimetype' => $cell['size'], 'type' => $type); if ($value[0] != '/') {