From c2c3a0e6080ed58e38c4c708e07d061cbfca6b6c Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 16 Oct 2018 19:39:05 +0200 Subject: [PATCH] Fix encoding issue in bbcode PIP when writing via GUI See #2545 --- .../BBCodePackageInstallationPlugin.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php index 7813ddbbb5..43b3644b18 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php @@ -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'])); -- 2.20.1