|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-04-05 10:29 UTC] requinix@php.net
-Status: Open
+Status: Verified
[2020-04-05 10:29 UTC] requinix@php.net
[2020-04-07 09:12 UTC] cmb@php.net
[2022-08-19 11:55 UTC] git@php.net
[2022-08-19 11:55 UTC] git@php.net
-Status: Verified
+Status: Closed
[2022-08-19 16:16 UTC] git@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
Description: ------------ While attempting to change a loaded DOM document's DOCTYPE I ran into a double free crash, this happens after creating a new DOMDocumentType object using DOMImplementation and attempting to use replaceChild on the DOMDocument. Side note: *please* can you provide us with a clear and official documented way to change a loaded document doctype? something that we can do between loadHTML() and saveHTML() to change the doctype..thx. Test script: --------------- <?php $dom = new \DOMDocument(); $dom->loadHTML("<!DOCTYPE html><p>hello</p>"); $impl = new \DOMImplementation(); $dt = $impl->createDocumentType("html", "", ""); $dom->replaceChild($dt, $dom->doctype); Expected result: ---------------- DOCTYPE changed in memory representation Actual result: -------------- free(): double free detected in tcache 2 Aborted (core dumped)