From edcc7f994012c18658f3a9571217b974317e4f05 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 22 Aug 2014 00:32:33 -0700 Subject: [PATCH] CRM_Case_XMLRepository - Better reporting of XML parsing errors --- CRM/Case/XMLRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Case/XMLRepository.php b/CRM/Case/XMLRepository.php index 067af0bd5e..e3fec439be 100644 --- a/CRM/Case/XMLRepository.php +++ b/CRM/Case/XMLRepository.php @@ -81,7 +81,11 @@ class CRM_Case_XMLRepository { $definition = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $caseType, 'definition', 'name'); if (!empty($definition)) { - return simplexml_load_string($definition); + list ($xml, $error) = CRM_Utils_XML::parseString($definition); + if (!$xml) { + throw new CRM_Core_Exception("Failed to parse CaseType XML: $error"); + } + return $xml; } // TODO In 4.6 or 5.0, remove support for weird machine-names -- 2.25.1