From e054aa53186287e0b64aa59882befe9ce94ba53c Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 8 Oct 2009 17:24:46 +0000 Subject: use original xml in err msg --- it_xml.class | 8 +++++--- 1 file 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 = '_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; -- cgit v1.2.3