Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.2

Bug #778 Regular expression skips the first tag after the DOCTYPE in the DTD
Submitted: 2004-02-17 16:06 UTC
From: rshaull at simanage dot com Assigned: schst
Status: Closed Package: XML_DTD
PHP Version: 4.3.4 OS: Windows 2000
Roadmaps: (Not assigned)    
Subscription  


 [2004-02-17 16:06 UTC] rshaull at simanage dot com
Description: ------------ The first <!ELEMENT is ignored in a DTD because the regular expression on line 127 of DTD.php pulls the contents of the first <!ELEMENT into the <!DOCTYPE [ element, so that the first match looks something like this: DOCTYPE document [ <!ELEMENT document (page+) I resolved it on my server by replacing '|<!([^>]+)>|s' with '/<!([^\[>]+)>/s'. Please see http://dev.simanage.com/download/php-bugs/xml_dtd/001/ for a detailed report and tests. Reproduce code: --------------- Please visit this URL for full bug report: http://dev.simanage.com/download/php-bugs/xml_dtd/001/ Expected result: ---------------- When I run the validator on pretty much an XML-DTD pair I get back 'invalid' because the first <!ELEMENT is not parsed into the XML tree that represents the DTD. Actual result: -------------- After applying my fix I get 'invalid' only for documents that are actually invalid and 'valid' for the rest.

Comments

 [2004-05-17 19:43 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-05-17 23:32 UTC] rshaull at simanage dot com
Sorry about the unavailability. The page should be accessible now. I posted this report quite a while ago and had almost forgotten about it... I think you are right (about "<!DOCTYPE [" not belonging in an external DTD). I don't write DTDs very often, and I guess I had the syntax confused with inline DTDs. Well, thanks for checking into it.