[PHPTAL] Patch: wrong assert for end-tags

Christoph Frick frick at sc-networks.com
Tue Jan 29 10:09:58 CET 2008


Hi list,

i switched my project over to the recent release of phptal and got lots
of asserts in the generated xml code. According to W3C the allowed chars
for an XML-tag also include the ``_``. Maybe this check should be
dropped at all - the next line in the code should do an sufficient
check?

-- 
cu

diff -ru PHPTAL/Dom/Parser.php PHPTAL-1.1.10/PHPTAL/Dom/Parser.php
--- PHPTAL/Dom/Parser.php	2008-01-28 13:11:43.000000000 +0100
+++ PHPTAL-1.1.10/PHPTAL/Dom/Parser.php	2008-01-26 00:26:18.000000000 +0100
@@ -128,7 +128,7 @@
 
     public function onElementClose($name)
     {
-        assert('preg_match("/^[a-z0-9:]+$/",$name)');	
+        assert('preg_match("/^[a-z0-9:_]+$/",$name)');	
 		if (!$this->_current instanceof PHPTAL_Dom_Element) $this->raiseError("Found closing tag for '$name' where there are no open tags");			
         if ($this->_current->getName() != $name) {
             $this->raiseError(self::ERR_ELEMENT_CLOSE_MISMATCH, $this->_current->getName(), $name);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : http://lists.motion-twin.com/pipermail/phptal/attachments/20080130/e9e87012/attachment.pgp


More information about the PHPTAL mailing list