From 880a824f2fa430636db4cd4412ef794b4b8565aa Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 3 Aug 2023 09:40:39 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B06562=20Replace=20`new=20DOMText()`=20by?= =?UTF-8?q?=20\DOMDocument::createTextNode=20Because=20init=20using=20cons?= =?UTF-8?q?tructor=20outputs=20a=20read=20only=20node,=20see=20https://www?= =?UTF-8?q?.php.net/manual/en/domelement.construct.php=20Thanks=20@Hipska?= =?UTF-8?q?=20See=20conversation=20in=20734a788?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/itopdesignformat.class.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup/itopdesignformat.class.inc.php b/setup/itopdesignformat.class.inc.php index 16bd70807..7833e637d 100644 --- a/setup/itopdesignformat.class.inc.php +++ b/setup/itopdesignformat.class.inc.php @@ -895,7 +895,9 @@ class iTopDesignFormat // N°6562 textContent is readonly, see https://www.php.net/manual/en/class.domnode.php#95545 // $oNode->textContent = $sCode; // N°6562 to update text node content we must use the node methods ! - $oTextContentNode = new DOMText($sCode); + // we are using DOMDocument::createTextNode instead of new DOMText because elements created using the constructor are read only + // see https://www.php.net/manual/en/domelement.construct.php + $oTextContentNode = $this->oDocument->createTextNode($sCode); $oNode->appendChild($oTextContentNode); } }