#42391 [NEW]: DOM handles doctype incorrectly.

From: Date: Wed, 22 Aug 2007 21:45:43 +0000
Subject: #42391 [NEW]: DOM handles doctype incorrectly.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116501@lists.php.net to get a copy of this message
From: linus dot martensson at elplan-gm dot se Operating system: Linux - Ubuntu Feisty Fawn PHP version: 5.2.3 PHP Bug Type: DOM XML related Bug description: DOM handles doctype incorrectly. Description: ------------ The DOM parser fails to parse SEVERAL valid xhtml entities, such as &raquo; and &rArr;, even though both are specified in http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent and http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent. These two files (among others) are referred to by the specified doctype definition, xhtml1-strict.dtd. The parser is obviously not taking all valid xhtml entities into account, which is a serious problem. Reproduce code: --------------- <?php $d = new DOMDocument(); if(!$d->loadXML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head></head><body>&#8658;&rArr;</body></html>')) var_dump(libxml_get_last_error()); Expected result: ---------------- No output, should correctly parse the document and store the two entities in the DOMDocument. Actual result: -------------- When the libXml error is retrieved, this is the apparent error: Line 1: Entity 'rArr' not defined. The parse is aborted. -- Edit bug report at http://bugs.php.net/?id=42391&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42391&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42391&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42391&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42391&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42391&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42391&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42391&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42391&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42391&r=support Expected behavior: http://bugs.php.net/fix.php?id=42391&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42391&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42391&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42391&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42391&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42391&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42391&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42391&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42391&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42391&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42391&r=mysqlcfg

« previous php.bugs (#116501) next »