From: [EMAIL PROTECTED]
Operating system: Linux
PHP version: 5CVS-2006-02-23 (CVS)
PHP Bug Type: DOM XML related
Bug description: DOMDocument::loadXML(): xmlns:D: 'DAV:' is not a valid URI in
Entity
Description:
------------
xmlns:D="DAV:" is actually used throughout the DAV RFC.
On another topic, DOMImplementation->createDocumentType("DAV:",...)
segfaults.
Reproduce code:
---------------
<?php
// PROPFIND response (Apache2/DAV2)
$xml = <<<DAVXML
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
<D:href>/</D:href>
<D:propstat>
<D:prop>
<lp1:resourcetype><D:collection/></lp1:resourcetype>
<lp1:creationdate>2005-11-12T11:25:47Z</lp1:creationdate>
<lp1:getlastmodified>Sat, 12 Nov 2005 11:25:47 GMT</lp1:getlastmodified>
<lp1:getetag>"19737a-1000-7fda84c0"</lp1:getetag>
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
</D:supportedlock>
<D:lockdiscovery/>
<D:getcontenttype>httpd/unix-directory</D:getcontenttype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
DAVXML;
$dom = new DOMImplementation;
$dtd = $dom->createDocumentType("webdav", "",
"http://dev.iworks.at/webdav-1.0.dtd");
$doc = $dom->createDocument("", "", $dtd);
$doc->validateOnParse = true;
$doc->loadXML($xml);
?>
Expected result:
----------------
Validation success
Actual result:
--------------
Notice: DOMDocument::loadXML(): xmlns:D: 'DAV:' is not a valid URI in
Entity, line: 2 in ...
Notice: DOMDocument::loadXML(): Validation failed: no DTD found
!xmlns:lp1: 'DAV:' is not a valid URI in Entity, line: 3 in ...
--
Edit bug report at http://bugs.php.net/?id=36501&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36501&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36501&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36501&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36501&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36501&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36501&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36501&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36501&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36501&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36501&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36501&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36501&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36501&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36501&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36501&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36501&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36501&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36501&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36501&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36501&r=mysqlcfg