From ca18ad9c814ece819e8f222e4623b0fdbd859fec Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 25 Jan 2006 04:24:27 +0000 Subject: [PATCH] A fix for PHP 5.1.2 and bug://report/1 where the XML module would fail because we were passing expressions to a referenced argument --- xml.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xml.php b/xml.php index 955a4a8..d8e6594 100644 --- a/xml.php +++ b/xml.php @@ -202,6 +202,9 @@ class XML */ function handle_tag_start(&$parser, $name, $attrs) { + // we need to keep track of indicies to monitor the last key in $this->attribs + static $index; + // trim attributes array_walk($attrs, 'trim'); @@ -217,12 +220,16 @@ class XML } // create a new child node - $this->attach_node($this->attribs["$name"][] = (array)$attrs); + $this->attribs["$name"][ $index["$name"] ] = (array)$attrs; + $this->attach_node($this->attribs["$name"][ $index["$name"] ]); + $index["$name"]++; } // node set doesn't exist, so create it else { - $this->attach_node($this->attribs["$name"] = (array)$attrs); + $this->attribs["$name"] = (array)$attrs; + $this->attach_node($this->attribs["$name"]); + $index["$name"] = 1; } } -- 2.43.5