php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36501 DOMDocument::loadXML(): xmlns:D: 'DAV:' is not a valid URI in Entity
Submitted: 2006-02-23 22:37 UTC Modified: 2006-02-23 23:21 UTC
From: mike@php.net Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5CVS-2006-02-23 (CVS) OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mike@php.net
New email:
PHP Version: OS:

 

 [2006-02-23 22:37 UTC] mike@php.net
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 ...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-23 23:21 UTC] chregu@php.net
 AFAIK, this is fixed in one of the later releases. Anyway not 
a PHP but a libxml2 issue :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 01 01:01:30 2025 UTC