`textContent` is not writable in PHP < 5.6.1
authorAlexander Ebert <ebert@woltlab.com>
Tue, 20 Dec 2016 13:30:39 +0000 (14:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 20 Dec 2016 13:30:45 +0000 (14:30 +0100)
wcfsetup/install/files/lib/system/event/listener/AbstractHtmlInputNodeProcessorListener.class.php
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php
wcfsetup/install/files/lib/system/html/metacode/converter/CodeMetacodeConverter.class.php

index 55785b89f1a7e57a72768e65fb03e4a0e86fb3fa..4078e8cf4ef9a3be471bacd1ec50d53b58b2a59f 100644 (file)
@@ -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();
                                        }
                                }
                        }
index e49f64b87d56c792d5d6e6918eaa75e98f7df132..320c464caf069887b47a30fc02607cb21009b3a2 100644 (file)
@@ -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));
                                }
                        }
                }
index e0dd65f0f232d35eaad3db9da045edd749a18258..632b31859ba4e91131a63d99ac34992554cf3080 100644 (file)
@@ -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;
        }