Bug #67012 [NEW]: Percent sign within NOTATION is incorrectly parsed as a parameter entity refere
| From: | petrhudecek2010 at gmail dot com | Date: | Thu, 03 Apr 2014 17:35:38 +0000 |
| Subject: | Bug #67012 [NEW]: Percent sign within NOTATION is incorrectly parsed as a parameter entity refere | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185076@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:Percent sign within NOTATION is incorrectly parsed as a parameter entity refere
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 bug report at https://bugs.php.net/bug.php?id=67012&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67012&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67012&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67012&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67012&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67012&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67012&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67012&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67012&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67012&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67012&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67012&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67012&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67012&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67012&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67012&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67012&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67012&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67012&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67012&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67012&r=mysqlcfg