Fix encoding issue in bbcode PIP when writing via GUI
authorMatthias Schmidt <gravatronics@live.com>
Tue, 16 Oct 2018 17:39:05 +0000 (19:39 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 16 Oct 2018 17:39:05 +0000 (19:39 +0200)
See #2545

wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php

index 7813ddbbb51fc9acc4c07151acd9449388ed1b40..43b3644b18d1e959d91d19bff2f3ec626d41df5f 100644 (file)
@@ -504,8 +504,14 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug
                        $bbcode,
                        [
                                'classname' => '',
-                               'htmlclose' => '',
-                               'htmlopen' => '',
+                               'htmlclose' => [
+                                       'cdata' => true,
+                                       'defaultValue' => ''
+                               ],
+                               'htmlopen' => [
+                                       'cdata' => true,
+                                       'defaultValue' => ''
+                               ],
                                'isBlockElement' => 0,
                                'sourcecode' => 0,
                                'buttonlabel' => '',
@@ -523,7 +529,9 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug
                                $attribute->setAttribute('name', (string) $attributeNumber);
                                
                                if (!empty($attributeData['attributeHtml'])) {
-                                       $attribute->appendChild($document->createElement('html', $attributeData['attributeHtml']));
+                                       $html = $document->createElement('html');
+                                       $html->appendChild($document->createCDATASection($attributeData['attributeHtml']));
+                                       $attribute->appendChild($html);
                                }
                                if (!empty($attributeData['validationPattern'])) {
                                        $attribute->appendChild($document->createElement('validationpattern', $attributeData['validationPattern']));