From f872b5b6e34c5668e8da20f42d4e6d64dc347812 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Thu, 8 Feb 2024 10:35:39 +0100 Subject: [PATCH] Using html upcast --- .../message/ConversationMessageAction.class.php | 8 ++++++++ templates/conversationMessageInlineEditor.tpl | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/files/lib/data/conversation/message/ConversationMessageAction.class.php b/files/lib/data/conversation/message/ConversationMessageAction.class.php index 7890b60..c28e81e 100644 --- a/files/lib/data/conversation/message/ConversationMessageAction.class.php +++ b/files/lib/data/conversation/message/ConversationMessageAction.class.php @@ -20,6 +20,7 @@ use wcf\system\exception\PermissionDeniedException; use wcf\system\exception\UserInputException; use wcf\system\flood\FloodControl; use wcf\system\html\input\HtmlInputProcessor; +use wcf\system\html\upcast\HtmlUpcastProcessor; use wcf\system\message\censorship\Censorship; use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; use wcf\system\message\QuickReplyManager; @@ -363,9 +364,16 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements */ public function beginEdit() { + $upcastProcessor = new HtmlUpcastProcessor(); + $upcastProcessor->process( + $this->message->message, + 'com.woltlab.wcf.conversation.message', + $this->message->messageID + ); WCF::getTPL()->assign([ 'defaultSmilies' => SmileyCache::getInstance()->getCategorySmilies(), 'message' => $this->message, + 'messageText' => $upcastProcessor->getHtml(), 'permissionCanUseSmilies' => 'user.message.canUseSmilies', 'wysiwygSelector' => 'messageEditor' . $this->message->messageID, ]); diff --git a/templates/conversationMessageInlineEditor.tpl b/templates/conversationMessageInlineEditor.tpl index e5e9f6a..60575ee 100644 --- a/templates/conversationMessageInlineEditor.tpl +++ b/templates/conversationMessageInlineEditor.tpl @@ -3,7 +3,7 @@ + >{$messageText} {capture assign=wysiwygContainerID}messageEditor{@$message->messageID}{/capture} {include file='messageFormTabsInline' inConversationInlineEdit=true wysiwygContainerID=$wysiwygContainerID} -- 2.20.1