From: Alexander Ebert Date: Tue, 28 Jun 2016 15:36:24 +0000 (+0200) Subject: Fixed message form implementation X-Git-Tag: 3.0.0_Beta_1~1327 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc6bd73821f65ecc177216976cd977abb541babc;p=GitHub%2FWoltLab%2FWCF.git Fixed message form implementation --- diff --git a/wcfsetup/install/files/lib/form/MessageForm.class.php b/wcfsetup/install/files/lib/form/MessageForm.class.php index aa36f11bd1..df32f580c3 100644 --- a/wcfsetup/install/files/lib/form/MessageForm.class.php +++ b/wcfsetup/install/files/lib/form/MessageForm.class.php @@ -91,6 +91,12 @@ abstract class MessageForm extends AbstractCaptchaForm { */ public $maxTextLength = 0; + /** + * message object type for html processing + * @var string + */ + public $messageObjectType = ''; + /** * list of smiley categories * @var SmileyCategory[] @@ -199,6 +205,10 @@ abstract class MessageForm extends AbstractCaptchaForm { * Validates the message text. */ protected function validateText() { + if (empty($this->messageObjectType)) { + throw new \RuntimeException("Expected non-empty message object type for '".get_class($this)."'"); + } + if (empty($this->text)) { throw new UserInputException('text'); } @@ -209,7 +219,7 @@ abstract class MessageForm extends AbstractCaptchaForm { } $this->htmlInputProcessor = new HtmlInputProcessor(); - $this->htmlInputProcessor->process($this->text); + $this->htmlInputProcessor->process($this->text, $this->messageObjectType, 0); // TODO: add checks for disallowed bbcodes and stuff $this->htmlInputProcessor->validate();