diff options
author | Urban Müller | 2009-10-08 17:24:46 +0000 |
---|---|---|
committer | Urban Müller | 2009-10-08 17:24:46 +0000 |
commit | e054aa53186287e0b64aa59882befe9ce94ba53c (patch) | |
tree | 148e534579667e0222c60f003df8629234a1f3d8 | |
parent | 9e9a0c189ac2c9490cb605addef18a06e69fe138 (diff) | |
download | itools-e054aa53186287e0b64aa59882befe9ce94ba53c.tar.gz itools-e054aa53186287e0b64aa59882befe9ce94ba53c.tar.bz2 itools-e054aa53186287e0b64aa59882befe9ce94ba53c.zip |
use original xml in err msg
-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; |