Home » XML » XML_Util » Bug #9561
Not allowing underscores in middle of tags
Details
| Submitted | 2006-12-06 15:44 UTC |
|---|---|
| From | darren at cwebd dot co dot uk |
| Assigned | schst |
| Status | Closed |
| Package | XML_Util |
| PHP Version | 5.2.0 RC4 |
| OS | Linux 2.6.10 - Debian Sarge |
| Roadmaps | (Not assigned) |
Comments
[2006-12-06 15:44 UTC] darren at cwebd dot co dot uk
Description:
------------
When a tag name such as "TEST_UNDERSCORE" is passed to XML_Util::isValidName the test fails due to a regex error.
Test script:
---------------
$result = XML_Util::isValidName("TEST_UNDERSCORE");
if (PEAR::isError($result)) {
print "Invalid XML name: " . $result->getMessage();
}
FIX:
Line:753 change to:
if (!preg_match('/^([[:alpha:]_]([[:alnum:]\-\.]*)?:)?[[:alpha:]_]([[:alnum:]\_\-\.]+)?$/', $string)) {
Expected result:
----------------
isValidName should return true
Actual result:
--------------
isValidName should return's false