- if($_SESSION[ldapab][username] && $_REQUEST[save]){
- $_REQUEST[entry][jpegPhoto][]=_getUploadData();
+ if($_SESSION['ldapab']['username'] && !empty($_REQUEST['save']) && $_REQUEST['save']){
+ // prepare special data
+ $_REQUEST['entry']['photo'] = _getUploadData();
+ $_REQUEST['entry']['marker'] = explode(',',$_REQUEST['entry']['markers']);
+ unset($_REQUEST['entry']['markers']);
+
+ foreach(array_keys($_REQUEST['entry']) as $field){
+ if($FIELDS['_'.$field]){
+ // entry has to be handled as array -> clean it up (trim, unique, sort)
+ $_REQUEST['entry'][$field] = array_map('trim',$_REQUEST['entry'][$field]);
+ $_REQUEST['entry'][$field] = array_unique($_REQUEST['entry'][$field]);
+ $_REQUEST['entry'][$field] = array_filter($_REQUEST['entry'][$field]);
+ natcasesort($_REQUEST['entry'][$field]);
+ }
+ }