diff --git a/app/provision/index.php b/app/provision/index.php index 69c5046eb0..0c0d6087ef 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -444,8 +444,14 @@ header("Content-Type: text/plain; charset=iso-8859-1"); header("Content-Length: ".strlen($file_contents)); } else { - header("Content-Type: text/xml; charset=utf-8"); - header("Content-Length: ".strlen($file_contents)); + $result = simplexml_load_string ($file_contents, 'SimpleXmlElement', LIBXML_NOERROR+LIBXML_ERR_FATAL+LIBXML_ERR_NONE); + if (false == $result){ + header("Content-Type: text/plain"); + header("Content-Length: ".strval(strlen($file_contents))); + } else { + header("Content-Type: text/xml; charset=utf-8"); + header("Content-Length: ".strlen($file_contents)); + } } } echo $file_contents;