mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-18 22:48:28 +00:00
Update index.php (#2948)
Check whether loaded file is xml or not, if not xml than set Content-Type to text/plain
This commit is contained in:
committed by
FusionPBX
parent
9fc298d1b8
commit
705156f9ae
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user