`nodeValue` trips over entities when used w/ elements
authorAlexander Ebert <ebert@woltlab.com>
Wed, 21 Dec 2016 08:42:17 +0000 (09:42 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 21 Dec 2016 08:42:27 +0000 (09:42 +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 4078e8cf4ef9a3be471bacd1ec50d53b58b2a59f..41c06eadcdabc62098c4ccf14d6e324b4ed8cbff 100644 (file)
@@ -100,7 +100,8 @@ abstract class AbstractHtmlInputNodeProcessorListener implements IParameterizedE
                                                        throw new ImplementationException(get_class($object), ITitledObject::class);
                                                }
                                                
-                                               $element->nodeValue = $object->getTitle();
+                                               $element->nodeValue = '';
+                                               $element->appendChild($element->ownerDocument->createTextNode($object->getTitle()));
                                        }
                                }
                        }
index 320c464caf069887b47a30fc02607cb21009b3a2..dd4e836f8f9bc3f7638eb6ec968d75beace716b9 100644 (file)
@@ -393,7 +393,7 @@ class HtmlInputNodeTextParser {
                                        
                                        $element = $text->ownerDocument->createElement('a');
                                        $element->setAttribute('href', $link);
-                                       $element->nodeValue = $link;
+                                       $element->appendChild($element->ownerDocument->createTextNode($link));
                                }
                                else {
                                        return $matches[0];
index 632b31859ba4e91131a63d99ac34992554cf3080..911143f8aa238148d71f992cb9ba0a5051c03665 100644 (file)
@@ -100,7 +100,9 @@ class CodeMetacodeConverter extends AbstractMetacodeConverter {
                }
                
                // trim code block
-               $element->nodeValue = StringUtil::trim($element->textContent);
+               $content = StringUtil::trim($element->textContent);
+               $element->nodeValue = '';
+               $element->appendChild($element->ownerDocument->createTextNode($content));
                
                return $element;
        }