* parsed signature cache
* @var string
*/
- public $signatureCache = null;
+ public $signatureCache;
/**
+ * TODO: this is still missing
* @inheritDoc
*/
public $allowedBBCodesPermission = 'user.signature.allowedBBCodes';
- /**
- * @inheritDoc
- */
- public $permissionCanUseSmilies = 'user.signature.canUseSmilies';
-
- /**
- * @inheritDoc
- */
- public $permissionCanUseHtml = 'user.signature.canUseHtml';
-
- /**
- * @inheritDoc
- */
- public $permissionCanUseBBCodes = 'user.signature.canUseBBCodes';
-
/**
* @inheritDoc
*/
// default values
if (empty($_POST)) {
- $this->enableBBCodes = WCF::getUser()->signatureEnableBBCodes;
- $this->enableHtml = WCF::getUser()->signatureEnableHtml;
- $this->enableSmilies = WCF::getUser()->signatureEnableSmilies;
$this->text = WCF::getUser()->signature;
- $this->preParse = true;
}
$this->signatureCache = SignatureCache::getInstance()->getSignature(WCF::getUser());
$this->objectAction = new UserAction([WCF::getUser()], 'update', [
'data' => array_merge($this->additionalFields, [
- 'signature' => $this->text,
- 'signatureEnableBBCodes' => $this->enableBBCodes,
- 'signatureEnableHtml' => $this->enableHtml,
- 'signatureEnableSmilies' => $this->enableSmilies
+ 'signature' => $this->htmlInputProcessor->getHtml(),
+ 'signatureEnableHtml' => 1
])
]);
$this->objectAction->executeAction();
<?php
namespace wcf\system\user\signature;
use wcf\data\user\User;
-use wcf\system\bbcode\MessageParser;
+use wcf\system\html\output\HtmlOutputProcessor;
use wcf\system\SingletonFactory;
/**
* @package WoltLabSuite\Core\System\User\Signature
*/
class SignatureCache extends SingletonFactory {
+ /**
+ * @var HtmlOutputProcessor
+ */
+ protected $htmlOutputProcessor;
+
/**
* cached signatures
* @var string
/**
* Returns a parsed user signature.
*
- * @param \wcf\data\user\User $user
- * @return string
+ * @param User $user user object
+ * @return string parsed signature
*/
public function getSignature(User $user) {
if (!isset($this->signatures[$user->userID])) {
- $this->signatures[$user->userID] = MessageParser::getInstance()->parse($user->signature, $user->signatureEnableSmilies, $user->signatureEnableHtml, $user->signatureEnableBBCodes, false);
+ if ($this->htmlOutputProcessor === null) {
+ $this->htmlOutputProcessor = new HtmlOutputProcessor();
+ }
+
+ $this->htmlOutputProcessor->process($user->signature, 'com.woltlab.wcf.userSignature', $user->userID);
+ $this->signatures[$user->userID] = $this->htmlOutputProcessor->getHtml();
}
return $this->signatures[$user->userID];
enableGravatar TINYINT(1) NOT NULL DEFAULT 0,
gravatarFileExtension VARCHAR(3) NOT NULL DEFAULT '',
signature TEXT,
- signatureEnableBBCodes TINYINT(1) NOT NULL DEFAULT 1,
signatureEnableHtml TINYINT(1) NOT NULL DEFAULT 0,
- signatureEnableSmilies TINYINT(1) NOT NULL DEFAULT 1,
disableSignature TINYINT(1) NOT NULL DEFAULT 0,
disableSignatureReason TEXT,
disableSignatureExpires INT(10) NOT NULL DEFAULT 0,