Bug #67012 [Opn->Nab]: Percent sign within NOTATION is incorrectly parsed as a parameter entity refere
| From: | ab@php.net | Date: | Sat, 05 Apr 2014 16:49:35 +0000 |
| Subject: | Bug #67012 [Opn->Nab]: Percent sign within NOTATION is incorrectly parsed as a parameter entity refere | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185113@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67012&edit=1
ID: 67012
Updated by: ab@php.net
Reported by: petrhudecek2010 at gmail dot com
Summary: Percent sign within NOTATION is incorrectly parsed
as a parameter entity refere
-Status: Open
+Status: Not a bug
Type: Bug
Package: DOM XML related
Operating System: Windows
PHP Version: 5.5.11
Block user comment: N
Private report: N
New Comment:
$ xmllint --noout --dtdvalid --loaddtd test.xml
test.dtd:2: parser error : PEReference: expecting ';'
<!NOTATION image SYSTEM "%SYSTEMROOT%/paint.exe">
Getting this on your test XML code with libxml 2.9.1 . So looks like you could file a bug against
libxml2 as this is not a PHP bug.
Thanks for reporting.
Previous Comments:
------------------------------------------------------------------------
[2014-04-03 17:35:37] petrhudecek2010 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/class.domdocumenttype
---
The string
<!NOTATION image SYSTEM "%SYSTEMROOT%/paint.exe">
causes a libxml error.
Per the XML specification, a parameter entity reference cannot be recognized inside a SystemLiteral.
The percent sign itself is permitted in the NOTATION.
4.4
Reference in DTD
as a reference within either the internal or external subsets of the DTD, but outside of an
EntityValue, AttValue, PI, Comment, SystemLiteral, PubidLiteral, or the contents of an ignored
conditional section (see 3.4 Conditional Sections).
2.3
[11] SystemLiteral ::= ('"' [^"]* '"') |
("'" [^']* "'")
Test script:
---------------
$xmlDom = new DOMDocument();
$xmlDom->load("test.xml", LIBXML_DTDLOAD | LIBXML_DTDVALID | LIBXML_NOENT);
test.xml:
<?xml version="1.0" ?>
<!DOCTYPE root SYSTEM "test.dtd">
<root />
test.dtd:
<!ELEMENT root EMPTY>
<!NOTATION image SYSTEM "%SYSTEMROOT%/paint.exe">
Expected result:
----------------
No LIBXML error is generated and the document is correctly parsed and loaded.
Actual result:
--------------
Warning: DOMDocument::load(): PEReference: expecting ';' in
file:///D:/XAMPP/htdocs/preview/tests/test.dtd, line: 2 in D:\XAMPP\htdocs\preview\tests\test.php on
line 49
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67012&edit=1