diff options
Diffstat (limited to 'it_xml.class')
-rw-r--r-- | it_xml.class | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/it_xml.class b/it_xml.class index a048b58..1686478 100644 --- a/it_xml.class +++ b/it_xml.class @@ -83,9 +83,11 @@ function from_xml($xmldata, $p) } else { + $xmlorig = $xmldata; + $xmldata = trim($xmldata); + # Add header for charset detection (PHP5) if no header/BOM # See http://www.w3.org/TR/2006/REC-xml-20060816/#sec-guessing - $xmldata = trim($xmldata); if (!preg_match('/^(<\?xml|\xEF\xBB\xBF|\xFE\xFF|\xFF\xFE|\x00\x00\xFE\xFF|\x00\x00\xFF\xFE)/', $xmldata)) $xmldata = '<?xml version="1.0" encoding="' . $this->_p['encoding'] . '"?>' . $xmldata; @@ -106,9 +108,9 @@ function from_xml($xmldata, $p) if ($this->error) { if ($this->_p['safety'] >= 2) - it::fatal($this->error); + it::fatal(array('title' => $this->error, 'body' => $xmlorig)); else if ($this->_p['safety'] >= 1) - it::error(array('title' => $this->error, 'body' => $xmldata)); + it::error(array('title' => $this->error, 'body' => $xmlorig)); if ($this->_p['factory']) $GLOBALS['IT_XML_ERROR'] = $this->error; |