php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81682 DocumentType nodes cannot be cloned nor imported
Submitted: 2021-12-01 08:01 UTC Modified: 2024-03-09 16:10 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jules dot bernable at gmail dot com Assigned: nielsdos (profile)
Status: Closed Package: DOM XML related
PHP Version: 8.1.0 OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jules dot bernable at gmail dot com
New email:
PHP Version: OS:

 

 [2021-12-01 08:01 UTC] jules dot bernable at gmail dot com
Description:
------------
When trying to clone or import a doctype node, the operation always fail.
AFAICT there's nothing in the DOM standard saying this should be the case (see https://dom.spec.whatwg.org/#dom-document-importnode).


Test script:
---------------
$original = new DOMDocument();
$original->loadHTML('<!DOCTYPE html>');
$docytpe = $original->doctype->cloneNode();
var_dump($doctype); // false

$other = new DOMDocument();
$doctype = $other->importNode($original->doctype);
var_dump($doctype); // false

Expected result:
----------------
The result should be a new DocumentType node with the same name, publicId and systemId and, in the case of importNode, associated with the new document.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2022-08-17 05:25 UTC] prestigecitytownshipsarjapur at gmail dot com
prestigecity.gen.in
 [2022-11-28 08:37 UTC] ayhenswcnickolas at gmail dot com
hello
Purchasing multiple devices and gadgets can be very costly. The best option to perform cross-platform testing on different environments is to use emulators and virtualization. You can create own virtual machines with various platforms and configurations combinations to test applications.
(https://www.mybkexperience.review)github.com
 [2023-01-30 10:02 UTC] dhillonkeneth at gmail dot com
Unlike document.adoptNode() , the original node is not removed from its original document. The imported node is a clone of the original. These node types cannot be imported. Although DocumentType nodes can be imported, a document can only have one DocumentType. (https://www.upsers.app)github.com
 [2023-04-07 16:35 UTC] contact dot trustedwalls at gmail dot com
very nice

(https://morocco-itinerary.com/hsb/tour/2-tage-marrakesch-wustentour/)github.com

(https://morocco-itinerary.com/hsb/tour/marrakesch-wustentour-3-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-reise-3-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marrakesch-rundreise-4-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-4-tage-ab-marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-5-tage-von-marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-6-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-1-woche/)github.com

(https://morocco-itinerary.com/hsb/tour/10-tage-marokko-rundreise/)github.com

(https://morocco-itinerary.com/hsb/tour/12-tage-4-konigsstadte-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/2-tage-in-marokko-ab-fes-nach-merzouga/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-reiseprogramm/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-rundreise-individuell/)github.com

(https://morocco-itinerary.com/hsb/tour/4-tage-marokko-reise-ab-fes-nach-sahara/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-wustenreise-5-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-7-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-10-tage-individuell/)github.com

(https://morocco-itinerary.com/hsb/tour/13-tage-urlaub-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/kleine-rundreise-ab-rabat/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-reise-8-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/rundreise-marokko-mit-badeverlangerung/)github.com

(https://morocco-itinerary.com/hsb/tour/6-tage-marokko-urlaubsreise/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-individuell-erfahrungen/)github.com

(https://morocco-itinerary.com/hsb/tour/10-tage-marokko-rundreise-kleingruppe/)github.com

(https://morocco-itinerary.com/hsb/tour/8-tage-privatreise-in-marokko/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-12-tage-ab-tanger/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-selbstfahrer/)github.com

(https://morocco-itinerary.com/hsb/tour/nord-marokko-tour-2-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-nordreise/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-individuell-reise-4-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/bester-reiseanbieter-marokko/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-urlaub-6-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/morokko-rundreise-8-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-10-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-12-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-14-tage/)github.com
 [2023-04-07 18:31 UTC] contact dot trustedwalls at gmail dot com
wonderful blog full of value thanks for the sharing


(https://morocco-itinerary.com/es/tour/2-dias-desde-marrakech-al-desierto-2/)github.com

(https://morocco-itinerary.com/es/tour/recomendaciones-para-viajar-a-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/escapada-marrakech-3-dias/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-4-dias-que-hacer/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-viaje-5-dias/)github.com

(https://morocco-itinerary.com/es/tour/vacaciones-en-marruecos-5-dias/)github.com

(https://morocco-itinerary.com/es/tour/6-dias-en-marruecos-viajes/)github.com

(https://morocco-itinerary.com/es/tour/itinerario-marruecos-7-dias/)github.com

(https://morocco-itinerary.com/es/tour/visitar-marruecos-en-7-dias/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-8-dias/)github.com

(https://morocco-itinerary.com/es/tour/tour-marruecos-de-9-dias/)github.com

(https://morocco-itinerary.com/es/tour/visitar-marruecos-en-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/ruta-marruecos-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/gran-vuelta-a-marruecos-en-11-dias/)github.com

(https://morocco-itinerary.com/es/tour/tour-por-marruecos-12-dias/)github.com

(https://morocco-itinerary.com/es/tour/2-dias-viajes-en-marruecos-desde-fez-al-desierto/)github.com

(https://morocco-itinerary.com/es/tour/3-dias-desde-fez-al-desierto-de-merzouga/)github.com

(https://morocco-itinerary.com/es/tour/3-dias-de-fez-a-marrakech-por-el-desierto/)github.com

(https://morocco-itinerary.com/es/tour/4-dias-desde-fez-al-desierto-y-marrakech-2/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-4-dias-desde-fez-al-desierto/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-5-dias-4-noches-desde-marrakech/)github.com

(https://morocco-itinerary.com/es/tour/circuito-marruecos-6-dias/)github.com

(https://morocco-itinerary.com/es/tour/viaje-de-7-dias-en-marruecos-desde-fez/)github.com


(https://morocco-itinerary.com/es/tour/viaje-marruecos-7-dias/)github.com


(https://morocco-itinerary.com/es/tour/circuito-por-marruecos-8-dias/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-9-dias/)github.com

(https://morocco-itinerary.com/es/tour/mejor-10-dias-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/recorrer-marruecos-en-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-10-dias-en-marruecos-desde-fez/)github.com

(https://morocco-itinerary.com/es/tour/11-dias-en-marruecos-desierto-y-ciudades-imperiales/)github.com


(https://morocco-itinerary.com/es/tour/tour-de-12-dias-en-marruecos/)github.com


(https://morocco-itinerary.com/es/tour/tour-de-13-dias-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/tour-norte-de-marruecos-4-dias/)github.com

(https://morocco-itinerary.com/es/tour/5-dias-de-viaje-a-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/ruta-por-marruecos-en-6-dias-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/viaje-de-7-dias-al-norte-de-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/viaje-de-7-dias-alrededor-de-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/excursion-desde-casablanca-8-dias/)github.com

(hhttps://morocco-itinerary.com/es/tour/viaje-privado-de-9-dias-por-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-viaje-por-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/descubra-marruecos-en-10-dias/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-11-dias-por-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/tour-de-12-dias-por-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-13-dias-en-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-13-dias-de-viaje-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-14-dias-en-marruecos-desde-casablanca/)github.com

(https://morocco-itinerary.com/es/tour/5-dias-en-el-norte-de-marruecos-desde-tanger/)github.com

(https://morocco-itinerary.com/es/tour/ruta-de-6-dias-desde-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/ruta-7-dias-marruecos/)github.com


(https://morocco-itinerary.com/es/tour/itinerario-de-7-dias-en-marruecos/)github.com


(https://morocco-itinerary.com/es/tour/viaje-de-8-dias-desde-tanger-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/9-dias-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-10-dias-desde-tanger/)github.com

(https://morocco-itinerary.com/es/tour/10-dias-de-vacaciones-en-marruecos/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-11-dias-desde-tanger/)github.com

(https://morocco-itinerary.com/es/tour/marruecos-en-12-dias/)github.com


(https://morocco-itinerary.com/es/marruecos-viajes/)github.com


(https://morocco-itinerary.com/es/terminos-condiciones/)github.com

(https://morocco-itinerary.com/es/sobre-nosotros-el-equipo/)github.com

(https://morocco-itinerary.com/es/resenas/)github.com

(https://morocco-itinerary.com/es/resenas/)github.com

(https://morocco-itinerary.com/es/tour-destination/tanger-es/)github.com

(https://morocco-itinerary.com/es/tour-destination/marrakech-es/)github.com

(https://morocco-itinerary.com/es/tour-destination/fez-es/)github.com

(https://morocco-itinerary.com/es/tour-destination/casablanca-es/)github.com

(https://morocco-itinerary.com/es/marruecos-viajes/contacto/contacto-1/)github.com

(https://morocco-itinerary.com/es/marruecos-viajes/)github.com

(https://morocco-itinerary.com/)github.com

(https://morocco-itinerary.com/who-we-are/)github.com

(https://morocco-itinerary.com/reviews/)github.com

(https://morocco-itinerary.com/contact-2/)github.com

(https://morocco-itinerary.com/terms-conditions/)github.com

(https://morocco-itinerary.com/morocco-tours-packages-2/)github.com

(https://morocco-itinerary.com/can-i-travel-to-morocco-from-usa/)github.com

(https://morocco-itinerary.com/are-4-or-5-or-7-or-10-days-enough-in-morocco/)github.com

(https://morocco-itinerary.com/what-to-do-in-morocco-for-1-week/)github.com

(https://morocco-itinerary.com/morocco-travel-itinerary-5-days/)github.com

(https://morocco-itinerary.com/moroccan-tour-morocco-trips/)github.com

(https://morocco-itinerary.com/whats-morocco-flag-history/)github.com

(https://morocco-itinerary.com/tour/full-day-tour-from-marrakech-to-ait-benhaddou-kasbah/)github.com

(https://morocco-itinerary.com/tour/private-1-day-excursion-to-essaouira-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/private-1-day-excursion-to-imlil-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/1-day-trip-to-ouzoud-waterfalls/)github.com

(https://morocco-itinerary.com/merzouga-quad-biking-around-desert/)github.com

(https://morocco-itinerary.com/tour-destination/tangier/)github.com

(https://morocco-itinerary.com/tour-destination/marrakech/)github.com

(https://morocco-itinerary.com/tour-destination/fes/)github.com

(https://morocco-itinerary.com/tour/)github.com

(https://morocco-itinerary.com/tour-destination/casablanca/)github.com

(https://morocco-itinerary.com/who-we-are/)github.com

(https://morocco-itinerary.com/reviews/)github.com

(https://morocco-itinerary.com/contact-2/)github.com

(https://morocco-itinerary.com/terms-conditions/)github.com

(https://morocco-itinerary.com/hsb/marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/uber-uns-team/)github.com

(https://morocco-itinerary.com/hsb/marokko-reise/kontakt/)github.com

(https://morocco-itinerary.com/hsb/bewertungen/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/tanger/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/fes-hsb/)github.com

(https://morocco-itinerary.com/hsb/tour-destination/casablanca-hsb/)github.com

(https://morocco-itinerary.com/it/casa/viaggi-in-marocco/)github.com

(https://morocco-itinerary.com/it/chi-siamo-il-team/)github.com

(https://morocco-itinerary.com/it/itinerario-di-10-giorni-in-marocco/)github.com

(https://morocco-itinerary.com/it/tour-individuale-7-giorni-in-marocco/)github.com

(https://morocco-itinerary.com/it/tour-marocco-9-giorni/)github.com

(https://morocco-itinerary.com/it/viaggio-in-marocco-5-giorni/)github.com

(https://morocco-itinerary.com/it/casa/contattateci/)github.com

(https://morocco-itinerary.com/it/recensioni/)github.com

(https://morocco-itinerary.com/it/tour-destination/tanger-it/)github.com

(https://morocco-itinerary.com/it/tour-destination/marrakech-it/)github.com

(https://morocco-itinerary.com/it/tour-destination/fez-2/)github.com

(https://morocco-itinerary.com/it/tour-destination/casablanca-it/)github.com

(https://morocco-itinerary.com/it/tour/)github.com

(https://morocco-itinerary.com/tour/5-days-morocco-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/6-days-morocco-desert-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/morocco-itinerary-7-days/)github.com

(https://morocco-itinerary.com/tour/7-days-tour-in-morocco-from-marrakech-to-fes-via-sahara-desert/)github.com

(https://morocco-itinerary.com/tour/marrakech-trip-itinerary-in-7-days/)github.com

(https://morocco-itinerary.com/tour/8-days-morocco-tour/)github.com

(https://morocco-itinerary.com/tour/9-days-tour-in-morocco/)github.com

(https://morocco-itinerary.com/tour/10-days-in-morocco-in-november-may-april-december-september/)github.com

(https://morocco-itinerary.com/tour/10-days-tour-in-morocco/)github.com

(https://morocco-itinerary.com/tour/11-days-tour-in-morocco-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/morocco-12-days-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/tour/13-days-around-morocco-tour-from-marrakech/)github.com

(https://morocco-itinerary.com/hsb/tour/2-tage-marrakesch-wustentour/)github.com

(https://morocco-itinerary.com/hsb/tour/marrakesch-wustentour-3-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-reise-3-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marrakesch-rundreise-4-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-4-tage-ab-marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-5-tage-von-marrakesch/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-6-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-1-woche/)github.com

(https://morocco-itinerary.com/hsb/tour/10-tage-marokko-rundreise/)github.com

(https://morocco-itinerary.com/hsb/tour/12-tage-4-konigsstadte-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/2-tage-in-marokko-ab-fes-nach-merzouga/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-reiseprogramm/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-rundreise-individuell/)github.com

(https://morocco-itinerary.com/hsb/tour/4-tage-marokko-reise-ab-fes-nach-sahara/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-wustenreise-5-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-7-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-10-tage-individuell/)github.com

(https://morocco-itinerary.com/hsb/tour/13-tage-urlaub-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-reise/)github.com

(https://morocco-itinerary.com/hsb/tour/kleine-rundreise-ab-rabat/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-reise-8-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/rundreise-marokko-mit-badeverlangerung/)github.com

(https://morocco-itinerary.com/hsb/tour/6-tage-marokko-urlaubsreise/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-individuell-erfahrungen/)github.com

(https://morocco-itinerary.com/hsb/tour/10-tage-marokko-rundreise-kleingruppe/)github.com

(https://morocco-itinerary.com/hsb/tour/8-tage-privatreise-in-marokko/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-12-tage-ab-tanger/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-selbstfahrer/)github.com

(https://morocco-itinerary.com/hsb/tour/nord-marokko-tour-2-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/3-tage-marokko-nordreise/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-individuell-reise-4-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/bester-reiseanbieter-marokko/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-urlaub-6-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/morokko-rundreise-8-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-10-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-12-tage/)github.com

(https://morocco-itinerary.com/hsb/tour/marokko-rundreise-14-tage/)github.com
 [2024-03-09 16:10 UTC] nielsdos@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nielsdos
 [2024-03-09 16:10 UTC] nielsdos@php.net
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.

Fixed in PHP 8.4 for both old and new DOM.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 23:01:29 2024 UTC