PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_Util » Bug #5419

isValidString() incorrect

Details

Submitted2005-09-15 19:33 UTC
Fromvladimir at webrover dot ru
Assignedschst
StatusClosed
PackageXML_Util
PHP Version4.3.10
Roadmaps(Not assigned)

Comments

[2005-09-15 19:33 UTC] vladimir at webrover dot ru

Description:
------------
function isValidString() uses this regular expression to check, whether string is valid XML name:

/^([a-zA-Z_]([a-zA-Z0-9_\-\.]*)?:)?[a-zA-Z_]([a-zA-Z0-9_\-\.]+)?$/

i.e. XML letter defined as [a-zA-Z], which is not correct - it must include wider range of characters according to XML specification. I think, it would be better, but maybe not the best, to use this definition of letter:

/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?[[:alpha:]_]([[:alnum:]\-\.]+)?$/