ZF-2162: Zend_Config_Xml usage without sections bug


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.


The following would be accessed like this:

echo $config->home; // Errors out because it contains an empty Zend_Config obj;

Attached is the patch


Assigning to [~rob] to initiate issue review.

Hi Geoffrey,

Can you provide an example config.xml please ?



ok attaching the file...

The bug would happen on access to home and throw_exceptions since they are 1st level elements

Resolved in svn 6906 and svn 6907