From: Matthias Schmidt Date: Mon, 14 Jun 2021 09:26:19 +0000 (+0200) Subject: Support embedded objects in users' "About Me" text (#4282) X-Git-Tag: 5.5.0_Alpha_1~648 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=359b0d211fbdbf15c5213cb014eb472f12b9b3ec;p=GitHub%2FWoltLab%2FWCF.git Support embedded objects in users' "About Me" text (#4282) See #4253 --- 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);