From 88c5e0f7fef0b4a6b68e2f1d53f0cc001480d3b3 Mon Sep 17 00:00:00 2001
From: Pedro Navarro <pnavarro@netflix.com>
Date: Thu, 7 Nov 2013 14:50:41 -0800
Subject: [PATCH] Use the LIBXML_PARSEHUGE flag when loading XML files

---
 cdash/common.php |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/cdash/common.php b/cdash/common.php
index 6261eff..c639e9d 100644
--- a/cdash/common.php
+++ b/cdash/common.php
@@ -39,8 +39,14 @@ if (PHP_VERSION >= 5) {
         $xsl = new DomDocument;
 
         // Load the xml document and the xsl template
-        $xml->loadXML($args[$xml_arg]);
-        $xsl->loadXML(file_get_contents($xsl_arg));
+        if(LIBXML_VERSION >= 20700) {
+            $xmlOptions = LIBXML_PARSEHUGE;
+        } else {
+            $xmlOptions = 0;
+        }
+
+        $xml->loadXML($args[$xml_arg], $xmlOptions);
+        $xsl->loadXML(file_get_contents($xsl_arg), $xmlOptions);
 
         // Load the xsl template
         $xsltproc->importStyleSheet($xsl);
-- 
1.7.10.4

