From 4f6528534cb2500eaa8d40c5a14ebb2625b10d40 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 16 May 2013 15:30:00 -0400 Subject: [PATCH] CRM-12647 - CRM_Utils_Migrate - Extract constant for special delimiter ---------------------------------------- * CRM-12647: Customization export/import crashes on "&" http://issues.civicrm.org/jira/browse/CRM-12647 --- CRM/Utils/Migrate/Export.php | 4 +++- CRM/Utils/Migrate/Import.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Migrate/Export.php b/CRM/Utils/Migrate/Export.php index a3e5edd1b8..77da85aba3 100644 --- a/CRM/Utils/Migrate/Export.php +++ b/CRM/Utils/Migrate/Export.php @@ -34,6 +34,8 @@ */ class CRM_Utils_Migrate_Export { + const XML_VALUE_SEPARATOR = ":;:;:;"; + protected $_xml; function __construct() { @@ -405,7 +407,7 @@ AND entity_id IS NULL } else { $value = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, - ":;:;:;", + self::XML_VALUE_SEPARATOR, $object->$name ); $xml .= "\n <$name>$value"; diff --git a/CRM/Utils/Migrate/Import.php b/CRM/Utils/Migrate/Import.php index f12776a1cf..d2c312d65a 100644 --- a/CRM/Utils/Migrate/Import.php +++ b/CRM/Utils/Migrate/Import.php @@ -92,7 +92,7 @@ class CRM_Utils_Migrate_Import { foreach ($fields as $name => $dontCare) { if (isset($xml->$name)) { $value = (string ) $xml->$name; - $value = str_replace(":;:;:;", + $value = str_replace(CRM_Utils_Migrate_Export::XML_VALUE_SEPARATOR, CRM_Core_DAO::VALUE_SEPARATOR, $value ); -- 2.25.1