From: Tim Otten Date: Fri, 22 Aug 2014 07:32:33 +0000 (-0700) Subject: CRM_Case_XMLRepository - Better reporting of XML parsing errors X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=edcc7f994012c18658f3a9571217b974317e4f05;p=civicrm-core.git CRM_Case_XMLRepository - Better reporting of XML parsing errors --- 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