It appears the Zend_Config_Xml class does not differ from a SimpleXMLElement that contains children vs on that does not (eg a string) when not using sections.
For instance:
$config = new Zend_Config_Xml('ourFile.xml', null);
This would load everything under the root element without the use of sections, but because of this bug, it will set any 1st level element within the root element that is a string to an empty Zend_Config object instead of a string which is expected.
<root>
<!-- Should be a string -->
<home>../application</home>
<!-- Should be another Zend_Config Object -->
<other>
<foo>bar</foo>
</other>
</root>
The following would be accessed like this:
echo $config->home; // Errors out because it contains an empty Zend_Config obj;
Attached is the patch
Description
It appears the Zend_Config_Xml class does not differ from a SimpleXMLElement that contains children vs on that does not (eg a string) when not using sections.
For instance:
$config = new Zend_Config_Xml('ourFile.xml', null);
This would load everything under the root element without the use of sections, but because of this bug, it will set any 1st level element within the root element that is a string to an empty Zend_Config object instead of a string which is expected.
<root>
<!-- Should be a string -->
<home>../application</home>
<!-- Should be another Zend_Config Object -->
<other>
<foo>bar</foo>
</other>
</root>
The following would be accessed like this:
echo $config->home; // Errors out because it contains an empty Zend_Config obj;
Geoffrey Tran added a comment - 16/Nov/07 05:42 PM ok attaching the file...
The bug would happen on access to home and throw_exceptions since they are 1st level elements
Assigning to
Rob Allen to initiate issue review.