$this->includeRules = array();
$doc = new DOMDocument();
- $oldValue = libxml_disable_entity_loader(FALSE);
- $load = $doc->load(dirname(__FILE__) . '/' . $this->filename);
- libxml_disable_entity_loader($oldValue);
+ $xmlString = file_get_contents(dirname(__FILE__) . '/' . $this->filename);
+ $load = $doc->loadXML($xmlString);
if ($load) {
$regions = $doc->getElementsByTagName("region");
foreach ($regions as $region) {
if ($fileName && file_exists($fileName)) {
// read xml file
$dom = new DomDocument();
- $oldValue = libxml_disable_entity_loader(FALSE);
- $dom->load($fileName);
- libxml_disable_entity_loader($oldValue);
+ $xmlString = file_get_contents($fileName);
+ $dom->loadXML($xmlString);
+ $dom->documentURI = $fileName;
$dom->xinclude();
$fileXml = simplexml_import_dom($dom);
}
* @return SimpleXMLElement|bool
*/
public static function parse($file) {
- $oldValue = libxml_disable_entity_loader(FALSE);
$dom = new DomDocument();
- $dom->load($file);
- libxml_disable_entity_loader($oldValue);
+ $xmlString = file_get_contents($file);
+ $dom->loadXML($xmlString);
+ $dom->documentURI = $file;
$dom->xinclude();
$xml = simplexml_import_dom($dom);
return $xml;
public function run($file) {
// read xml file
$dom = new DomDocument();
- $oldValue = libxml_disable_entity_loader(FALSE);
- $load = $dom->load($file);
- libxml_disable_entity_loader($oldValue);
+ $xmlString = file_get_contents($file);
+ $load = $dom->loadXML($xmlString);
if (!$load) {
throw new CRM_Core_Exception("Failed to parse XML file \"$file\"");
}