Skip to content
Snippets Groups Projects
Commit 23c41970 authored by totten's avatar totten
Browse files

CRM-12647 - Simplify. Separate field-rewriting from XML encoding

----------------------------------------
* CRM-12647: Customization export/import crashes on "&"
  http://issues.civicrm.org/jira/browse/CRM-12647
parent d6379d54
No related branches found
No related tags found
No related merge requests found
......@@ -373,8 +373,9 @@ AND entity_id IS NULL
exit();
}
}
$value = $object->$name;
if ($name == 'field_name') {
$value = $object->$name;
// hack for profile field_name
if (substr($value, 0, 7) == 'custom_') {
$cfID = substr($value, 7);
......@@ -382,9 +383,6 @@ AND entity_id IS NULL
$value = "custom.{$tableName}.{$columnName}";
}
}
else {
$value = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, self::XML_VALUE_SEPARATOR, $object->$name);
}
$keyValues[$name] = $value;
}
}
......@@ -392,7 +390,7 @@ AND entity_id IS NULL
// We're ready to format $keyValues as XML
$xml = " <$objectName>";
foreach ($keyValues as $k => $v) {
$xml .= "\n " . $this->renderTextTag($k, $v);
$xml .= "\n " . $this->renderTextTag($k, str_replace(CRM_Core_DAO::VALUE_SEPARATOR, self::XML_VALUE_SEPARATOR, $v));
}
if ($additional) {
$xml .= $additional;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment