Permalink
Browse files

- Return PEAR Error when XML tree is empty

git-svn-id: http://svn.php.net/repository/pear/packages/XML_DTD/trunk@279483 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent b1ac0f7 commit 25b36b39b4f2cbabf8c2a2ba5058a46843d3725c @ifeghali ifeghali committed Apr 28, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 DTD/XmlParser.php
View
6 DTD/XmlParser.php
@@ -121,7 +121,11 @@ function factory($xml)
*/
unset($p->_handlerObj, $p->ptr);
- return $p->children[0];
+ if (count($p->children)) {
+ return $p->children[0];
+ } else {
+ return PEAR::raiseError('empty XML?');
+ }
}
/**

0 comments on commit 25b36b3

Please sign in to comment.