Fixes allowed BBCode issues
authorMatthias Schmidt <gravatronics@live.com>
Sat, 16 Mar 2013 15:00:04 +0000 (16:00 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 16 Mar 2013 15:00:04 +0000 (16:00 +0100)
Closes #57

files/lib/data/conversation/message/ConversationMessageAction.class.php

index 2e9ccb1a2cd480abd3202f86f6cbd0f2f468a0e6..1fcdb9df78adc2ae9bb871b0de024d9d4a58bbec 100644 (file)
@@ -8,6 +8,7 @@ use wcf\data\IExtendedMessageQuickReplyAction;
 use wcf\data\IMessageInlineEditorAction;
 use wcf\data\IMessageQuoteAction;
 use wcf\system\bbcode\BBCodeParser;
+use wcf\system\bbcode\PreParser;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\message\censorship\Censorship;
@@ -195,6 +196,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
         * @see wcf\data\IMessageQuickReply::validateQuickReply()
         */
        public function validateQuickReply() {
+               QuickReplyManager::getInstance()->setAllowedBBCodes(explode(',', WCF::getSession()->getPermission('user.message.allowedBBCodes')));
                QuickReplyManager::getInstance()->validateParameters($this, $this->parameters, 'wcf\data\conversation\Conversation');
        }
        
@@ -337,7 +339,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function save() {
                $messageEditor = new ConversationMessageEditor($this->message);
                $messageEditor->update(array(
-                       'message' => $this->parameters['data']['message']
+                       'message' => PreParser::getInstance()->parse($this->parameters['data']['message'], explode(',', WCF::getSession()->getPermission('user.message.allowedBBCodes')))
                ));
                
                // load new message