DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset

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: None

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2014-04-16 12:18 UTC] ab@php.net

-Status: Open +Status: Closed