BUGFIX Convert::recursiveXMLToArray() did not always check if the passed in XML is an object before calling get_class() on it

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@81894 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-07-15 06:17:24 +00:00 committed by Sam Minnee
parent b2374aabe6
commit 092108115d

View File

@ -230,7 +230,7 @@ class Convert extends Object {
}
protected static function recursiveXMLToArray($xml) {
if (get_class($xml) == 'SimpleXMLElement') {
if(is_object($xml) && get_class($xml) == 'SimpleXMLElement') {
$attributes = $xml->attributes();
foreach($attributes as $k=>$v) {
if ($v) $a[$k] = (string) $v;