Skip to content

Commit

Permalink
- Return PEAR Error when XML tree is empty
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/XML_DTD/trunk@279483 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
ifeghali committed Apr 28, 2009
1 parent b1ac0f7 commit 25b36b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DTD/XmlParser.php
Expand Up @@ -121,7 +121,11 @@ function factory($xml)
*/ */
unset($p->_handlerObj, $p->ptr); unset($p->_handlerObj, $p->ptr);


return $p->children[0]; if (count($p->children)) {
return $p->children[0];
} else {
return PEAR::raiseError('empty XML?');
}
} }


/** /**
Expand Down

0 comments on commit 25b36b3

Please sign in to comment.