php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
Submitted: 2014-04-15 18:45 UTC Modified: -
From: petrhudecek2010 at gmail dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 5.5.11 OS: Windows
Private report: No CVE-ID:
 [2014-04-15 18:45 UTC] petrhudecek2010 at gmail dot com
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>
]>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-16 12:18 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5224614f23eff18419f2c5489bebe60562e0ce2a
Log: Fixed bug #67081 DOMDocumentType-&gt;internalSubset returns entire DOCTYPE tag, not only the subset
 [2014-04-16 12:18 UTC] ab@php.net
-Status: Open +Status: Closed
 [2014-04-20 18:38 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5224614f23eff18419f2c5489bebe60562e0ce2a
Log: Fixed bug #67081 DOMDocumentType-&gt;internalSubset returns entire DOCTYPE tag, not only the subset
 [2014-04-20 18:39 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5224614f23eff18419f2c5489bebe60562e0ce2a
Log: Fixed bug #67081 DOMDocumentType-&gt;internalSubset returns entire DOCTYPE tag, not only the subset
 [2014-05-01 14:59 UTC] tyrael@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5224614f23eff18419f2c5489bebe60562e0ce2a
Log: Fixed bug #67081 DOMDocumentType-&gt;internalSubset returns entire DOCTYPE tag, not only the subset
 [2014-10-07 23:15 UTC] stas@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=5224614f23eff18419f2c5489bebe60562e0ce2a
Log: Fixed bug #67081 DOMDocumentType-&gt;internalSubset returns entire DOCTYPE tag, not only the subset
 [2014-10-07 23:26 UTC] stas@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=5224614f23eff18419f2c5489bebe60562e0ce2a
Log: Fixed bug #67081 DOMDocumentType-&gt;internalSubset returns entire DOCTYPE tag, not only the subset
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Jun 25 02:01:48 2017 UTC