From 5115c25bb852f8463b2d6584dc29024c7003e71c Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 1 Oct 2009 12:49:34 +0000 Subject: warn by default about bad xml --- it_xml.class | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/it_xml.class b/it_xml.class index 5dd4ead..fa67c4c 100644 --- a/it_xml.class +++ b/it_xml.class @@ -27,11 +27,11 @@ class it_xml * Add xml snippet as attribute tree to $this * @param $xmldata XML string or filehandle (result from fopen) to parse * @param $p associative array - * forcearray xml tags to ALWAYS return as array - * safety value 2 causes program abort with invalid xml, 1 causes error report - * encoding Output character encoding (e.g. UTF-8, default: ISO-8859-1) - * prefix Optional prefix for class names - * lowercase Lowercase all tag and attribute names + * @param $p['forcearray'] xml tags to ALWAYS return as array + * @param $p['safety'] 2 causes program abort with invalid xml, 1 (default) causes error report, 0 just returns false + * @param $p['encoding'] Output character encoding (e.g. UTF-8, default: ISO-8859-1) + * @param $p['prefix'] Optional prefix for class names + * @param $p['lowercase'] Lowercase all tag and attribute names * @return XML object tree or null on failure */ @@ -55,7 +55,7 @@ function create($xmldata, $p = array()) function from_xml($xmldata, $p) { - $this->_p = $p + array('encoding' => "ISO-8859-1"); + $this->_p = $p + array('encoding' => "ISO-8859-1", 'safety' => 1); $this->_arrayforce = array_flip((array)$this->_p['forcearray']); $this->_stack = array(); unset($this->error); -- cgit v1.2.3