From 5ed925b50f5111b11017ac77fa099ee3ed4b3958 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 20 Dec 2016 14:30:39 +0100 Subject: [PATCH] `textContent` is not writable in PHP < 5.6.1 --- .../AbstractHtmlInputNodeProcessorListener.class.php | 2 +- .../html/input/node/HtmlInputNodeTextParser.class.php | 8 ++++---- .../metacode/converter/CodeMetacodeConverter.class.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php b/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php index 55785b89f1..4078e8cf4e 100644 --- a/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php @@ -100,7 +100,7 @@ abstract class AbstractHtmlInputNodeProcessorListener implements IParameterizedE throw new ImplementationException(get_class($object), ITitledObject::class); } - $element->textContent = $object->getTitle(); + $element->nodeValue = $object->getTitle(); } } } diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php index e49f64b87d..320c464caf 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php @@ -162,7 +162,7 @@ class HtmlInputNodeTextParser { $value = preg_replace('~\x{200B}~u', '', $value); if ($value !== $oldValue) { - $node->textContent = $value; + $node->nodeValue = $value; } $this->detectMention($node, $value, $usernames); @@ -199,7 +199,7 @@ class HtmlInputNodeTextParser { } if ($value !== $oldValue) { - $node->textContent = $value; + $node->nodeValue = $value; } } @@ -393,7 +393,7 @@ class HtmlInputNodeTextParser { $element = $text->ownerDocument->createElement('a'); $element->setAttribute('href', $link); - $element->textContent = $link; + $element->nodeValue = $link; } else { return $matches[0]; @@ -587,7 +587,7 @@ class HtmlInputNodeTextParser { $node->parentNode->insertBefore($element, $node); // modify text content of existing text node - $node->textContent = mb_substr($value, $pos + strlen($marker)); + $node->nodeValue = mb_substr($value, $pos + strlen($marker)); } } } diff --git a/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php b/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php index e0dd65f0f2..632b31859b 100644 --- a/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php +++ b/wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php @@ -100,7 +100,7 @@ class CodeMetacodeConverter extends AbstractMetacodeConverter { } // trim code block - $element->textContent = StringUtil::trim($element->textContent); + $element->nodeValue = StringUtil::trim($element->textContent); return $element; } -- 2.20.1