mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Fix addressbook HTML customfields were stripped of their tags when merging
This commit is contained in:
parent
dfb93cfa20
commit
ec04121692
@ -57,7 +57,7 @@ class Merge extends Api\Storage\Merge
|
||||
*/
|
||||
protected function get_replacements($id,&$content=null,$ignore_acl=false)
|
||||
{
|
||||
if (!($replacements = $this->contact_replacements($id,'',$ignore_acl)))
|
||||
if (!($replacements = $this->contact_replacements($id,'',$ignore_acl, $content)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -293,9 +293,21 @@ abstract class Merge
|
||||
foreach($ignore_acl ? Customfields::get('addressbook', true) : $this->contacts->customfields as $name => $field)
|
||||
{
|
||||
$name = '#'.$name;
|
||||
if(!$contact[$name])
|
||||
{
|
||||
$replacements['$$'.($prefix ? $prefix.'/':'').$name] = '';
|
||||
continue;
|
||||
}
|
||||
// Format date cfs per user Api\Preferences
|
||||
if($this->mimetype !== 'application/x-yaml' && $contact[$name] &&
|
||||
($field['type'] == 'date' || $field['type'] == 'date-time'))
|
||||
{
|
||||
$this->date_fields[] = '#'.$name;
|
||||
$replacements['$$'.($prefix ? $prefix.'/':'').$name.'$$'] = Api\DateTime::to($contact[$name], $field['type'] == 'date' ? true : '');
|
||||
}
|
||||
$replacements['$$'.($prefix ? $prefix.'/':'').$name.'$$'] =
|
||||
// use raw data for yaml, no user-preference specific formatting
|
||||
$this->mimetype == 'application/x-yaml' ? (string)$contact[$name] :
|
||||
$this->mimetype == 'application/x-yaml' || $field['type'] == 'htmlarea' ? (string)$contact[$name] :
|
||||
Customfields::format($field, (string)$contact[$name]);
|
||||
}
|
||||
|
||||
@ -895,7 +907,7 @@ abstract class Merge
|
||||
// some general replacements: current user, date and time
|
||||
if (strpos($content,'$$user/') !== null && ($user = $GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id')))
|
||||
{
|
||||
$replacements += $this->contact_replacements($user,'user');
|
||||
$replacements += $this->contact_replacements($user,'user', false, $content);
|
||||
$replacements['$$user/primary_group$$'] = $GLOBALS['egw']->accounts->id2name($GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'account_primary_group'));
|
||||
}
|
||||
$replacements['$$date$$'] = Api\DateTime::to('now',true);
|
||||
|
Loading…
Reference in New Issue
Block a user