Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 25b36b39b4f2cbabf8c2a2ba5058a46843d3725c 1 parent b1ac0f7
Igor Feghali ifeghali authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 DTD/XmlParser.php
6 DTD/XmlParser.php
View
@@ -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?');
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.