Permalink
Browse files

Now returns true when no name is supplied (when XML_Tree_Node is a CD…

…ATA node)

Modified:
XML_Tree::isValidName()


git-svn-id: http://svn.php.net/repository/pear/packages/XML_Tree/trunk@159716 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent ac20d24 commit 17ed0e828eedaed88421961ceceaeb69b2baff3f @dshafik dshafik committed May 26, 2004
Showing with 4 additions and 0 deletions.
  1. +4 −0 Tree.php
View
@@ -538,6 +538,10 @@ function &getElementsByTagNameFromNode($tagName, &$node)
*/
function isValidName($name, $type) {
+ if (trim($name) == '') {
+ return true;
+ }
+
// check for invalid starting character
if (!preg_match("/[[:alpha:]_]/", $name{0})) {
return new PEAR_Error( ucfirst($type) . " ('$name') has an invalid name, an XML name may only start with a letter or underscore");

0 comments on commit 17ed0e8

Please sign in to comment.