Bug #71497 [Opn->Csd]: DOMDocument::documentURI incorrect path converting

From: Date: Sat, 09 Mar 2024 16:12:49 +0000
Subject: Bug #71497 [Opn->Csd]: DOMDocument::documentURI incorrect path converting
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-246554@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71497&edit=1 ID: 71497 Updated by: nielsdos@php.net Reported by: pvlgood at gmail dot com Summary: DOMDocument::documentURI incorrect path converting -Status: Open +Status: Closed Type: Bug Package: DOM XML related Operating System: Windows 8.1 PHP Version: 5.6.17 -Assigned To: +Assigned To: nielsdos Block user comment: N Private report: N New Comment: The fix for this bug has been committed. If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test. Thank you for the report, and for helping us make PHP better. This is fixed in the new opt-in spec-compliance mode, which was merged in https://github.com/php/php-src/pull/13031. For more information about the opt-in mode, please see https://wiki.php.net/rfc/opt_in_dom_spec_compliance. In short: the behaviour of the old DOM classes are unaffected for backwards-compatibility reasons. There are new DOM classes where your code is correctly handled. This feature will be available in PHP 8.4. Previous Comments: ------------------------------------------------------------------------ [2016-02-04 14:46:00] eaton dot alf at gmail dot com This is also a problem when trying to load an XML file with a DTD: the path to the DTD file in the XML catalog is parsed incorrectly (converting "file:///" to "file:/"), so the DTD can't be loaded (the error given is "failed to load external entity"). This may be a libxml2 bug, as it broke between libxml versions 1.9.1 and 1.9.2, although the xmllint command line tool is still able to correctly load the DTD. ------------------------------------------------------------------------ [2016-02-02 09:03:48] pvlgood at gmail dot com sorry ------------------------------------------------------------------------ [2016-02-02 08:36:09] pvlgood at gmail dot com Description: ------------ See code sample below Test script: --------------- <?php $dd = new DOMDocument(); $dd->load('folder/file.xml'); echo $dd->documentURI; echo file_exists($dd->documentURI); /* output: file:/D:/folder/file.xml false should be: file://D:/folder/file.xml true */ ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71497&edit=1

« previous php.bugs (#246554) next »