Index: branches/RC/core/units/general/xml_helper.php =================================================================== diff -u -N -r10294 -r10446 --- branches/RC/core/units/general/xml_helper.php (.../xml_helper.php) (revision 10294) +++ branches/RC/core/units/general/xml_helper.php (.../xml_helper.php) (revision 10446) @@ -9,7 +9,7 @@ * @var kXMLNode */ var $CurrentElement = null; - + var $Mode; /** @@ -37,11 +37,11 @@ return $root_copy; } - + function ConvertHTMLEntities($s){ //build first an assoc. array with the entities we want to match $table1 = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); - + $patterns = array(); $replacements = array(); //now build another assoc. array with the entities we want to replace (numeric entities) @@ -50,13 +50,13 @@ // $c = htmlentities($k,ENT_QUOTES,"UTF-8"); $replacements[] = "&#".ord($k).";"; } - + //now perform a replacement using preg_replace //each matched value in array 1 will be replaced with the corresponding value in array 2 $s = preg_replace($patterns,$replacements,$s); return $s; } - + function startElement(&$Parser, &$Elem, $Attrs) { $parent =& $this->CurrentElement; // 1. $parent is now reference to $this->CurrentElement @@ -118,7 +118,7 @@ * @var int */ var $Position = 0; - + var $CRC = null; function kXMLNode($name, $attrs = array()) @@ -221,7 +221,7 @@ return $child->Data; } } - + /** * Returns next node to this, false in case of end list * @@ -254,8 +254,11 @@ $pos = $this->Position + 1; do { $ret =& $this->Parent->GetChildByPosition($pos++); - } while ($ret->Name == '_TEXT_' && $pos < count($this->Parent->Children)); - if ($ret->Name == '_TEXT_') $ret = false; + } while ($pos < count($this->Parent->Children) && ($ret->Name == '_TEXT_')); + + if (is_object($ret) && ($ret->Name == '_TEXT_')) { + $ret = false; + } return $ret; } else {