Bug #81682 [NEW]: DocumentType nodes cannot be cloned nor imported

From: Date: Wed, 01 Dec 2021 08:01:54 +0000
Subject: Bug #81682 [NEW]: DocumentType nodes cannot be cloned nor imported
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238075@lists.php.net to get a copy of this message
From: jules dot bernable at gmail dot com Operating system: irrelevant PHP version: 8.1.0 Package: DOM XML related Bug Type: Bug Bug description:DocumentType nodes cannot be cloned nor imported 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. -- Edit bug report at https://bugs.php.net/bug.php?id=81682&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81682&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81682&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81682&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81682&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81682&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81682&r=support Expected behavior: https://bugs.php.net/fix.php?id=81682&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81682&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81682&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81682&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81682&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81682&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81682&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81682&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81682&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81682&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81682&r=mysqlcfg

« previous php.bugs (#238075) next »