Bug #67081 [NEW]: DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset

From: Date: Tue, 15 Apr 2014 18:45:54 +0000
Subject: Bug #67081 [NEW]: DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185262@lists.php.net to get a copy of this message
From: petrhudecek2010 at gmail dot com Operating system: Windows PHP version: 5.5.11 Package: DOM XML related Bug Type: Bug Bug description:DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset Description: ------------ The DOM specification (http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-412266927) says that "The internal subset as a string, or null if there is none. This is does not contain the delimiting square brackets." However, PHP returns the entire tag, not only what is inside the square brackets. Test script: --------------- <?php $domDocument = new DOMDocument(); $domDocument->load("bug.xml"); echo $domDocument->doctype->internalSubset; -- bug.xml: -- <?xml version="1.0"?> <!DOCTYPE a [ <!ELEMENT a EMPTY> ]> <a></a> Expected result: ---------------- <!ELEMENT a EMPTY> Actual result: -------------- <!DOCTYPE a [ <!ELEMENT a EMPTY> ]> -- Edit bug report at https://bugs.php.net/bug.php?id=67081&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67081&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67081&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67081&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67081&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67081&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67081&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67081&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67081&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67081&r=support Expected behavior: https://bugs.php.net/fix.php?id=67081&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67081&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67081&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67081&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67081&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67081&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67081&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67081&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67081&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67081&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67081&r=mysqlcfg

« previous php.bugs (#185262) next »