From 359b0d211fbdbf15c5213cb014eb472f12b9b3ec Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 14 Jun 2021 11:26:19 +0200 Subject: [PATCH] Support embedded objects in users' "About Me" text (#4282) See #4253 --- .../option/user/MessageUserOptionOutput.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/lib/system/option/user/MessageUserOptionOutput.class.php b/wcfsetup/install/files/lib/system/option/user/MessageUserOptionOutput.class.php index d4d48ef8cb..2e2174b317 100644 --- a/wcfsetup/install/files/lib/system/option/user/MessageUserOptionOutput.class.php +++ b/wcfsetup/install/files/lib/system/option/user/MessageUserOptionOutput.class.php @@ -4,7 +4,9 @@ namespace wcf\system\option\user; use wcf\data\user\option\UserOption; use wcf\data\user\User; +use wcf\system\html\input\HtmlInputProcessor; use wcf\system\html\output\HtmlOutputProcessor; +use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; use wcf\system\WCF; use wcf\util\StringUtil; @@ -28,6 +30,14 @@ class MessageUserOptionOutput implements IUserOptionOutput return ''; } + // Load embedded objects by parsing the original message again because for the user options, there + // is no central way to save the embedded objects in the database. + $htmlInputProcessor = new HtmlInputProcessor(); + $htmlInputProcessor->setContext('com.woltlab.wcf.user.aboutMe', $user->userID); + $htmlInputProcessor->processIntermediate($value); + $htmlInputProcessor->processEmbeddedContent($value, 'com.woltlab.wcf.user.aboutMe', $user->userID); + MessageEmbeddedObjectManager::getInstance()->registerTemporaryMessage($htmlInputProcessor); + $htmlOutputProcessor = new HtmlOutputProcessor(); $htmlOutputProcessor->process($value, 'com.woltlab.wcf.user.aboutMe', $user->userID); -- 2.20.1