use wcf\data\comment\CommentList;
use wcf\system\bbcode\BBCodeHandler;
use wcf\system\html\input\HtmlInputProcessor;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
use wcf\system\WCF;
/**
$this->getBulkUserPermissionValue($userPermissions, $comment->userID, 'user.comment.disallowedBBCodes')
));
+ $data = [];
+
// update message
if (!$comment->enableHtml) {
$this->getHtmlInputProcessor()->process(
true
);
- $commentEditor->update([
- 'message' => $this->getHtmlInputProcessor()->getHtml(),
- 'enableHtml' => 1,
- ]);
+ $data['enableHtml'] = 1;
} else {
$this->getHtmlInputProcessor()->reprocess(
$comment->message,
'com.woltlab.wcf.comment',
$comment->commentID
);
- $commentEditor->update(['message' => $this->getHtmlInputProcessor()->getHtml()]);
}
+
+ if (MessageEmbeddedObjectManager::getInstance()->registerObjects($this->getHtmlInputProcessor(), true)) {
+ $data['hasEmbeddedObjects'] = 1;
+ } else {
+ $data['hasEmbeddedObjects'] = 0;
+ }
+
+ $data['message'] = $this->getHtmlInputProcessor()->getHtml();
+ $commentEditor->update($data);
}
WCF::getDB()->commitTransaction();
}
use wcf\data\comment\response\CommentResponseList;
use wcf\system\bbcode\BBCodeHandler;
use wcf\system\html\input\HtmlInputProcessor;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
use wcf\system\WCF;
/**
$this->getBulkUserPermissionValue($userPermissions, $response->userID, 'user.comment.disallowedBBCodes')
));
+ $data = [];
+
// update message
if (!$response->enableHtml) {
$this->getHtmlInputProcessor()->process(
true
);
- $responseEditor->update([
- 'message' => $this->getHtmlInputProcessor()->getHtml(),
- 'enableHtml' => 1,
- ]);
+ $data['enableHtml'] = 1;
} else {
$this->getHtmlInputProcessor()->reprocess(
$response->message,
'com.woltlab.wcf.comment.response',
$response->responseID
);
- $responseEditor->update(['message' => $this->getHtmlInputProcessor()->getHtml()]);
}
+
+ if (MessageEmbeddedObjectManager::getInstance()->registerObjects($this->getHtmlInputProcessor(), true)) {
+ $data['hasEmbeddedObjects'] = 1;
+ } else {
+ $data['hasEmbeddedObjects'] = 0;
+ }
+
+ $data['message'] = $this->getHtmlInputProcessor()->getHtml();
+ $responseEditor->update($data);
}
WCF::getDB()->commitTransaction();
}