use wcf\data\smiley\SmileyCache;
use wcf\data\user\User;
use wcf\form\AbstractForm;
+use wcf\system\bbcode\BBCodeHandler;
use wcf\system\cache\builder\ArticleCategoryLabelCacheBuilder;
use wcf\system\exception\UserInputException;
use wcf\system\html\input\HtmlInputProcessor;
}
}
+ $this->setDisallowedBBCodes();
+
if ($this->isMultilingual) {
foreach (LanguageFactory::getInstance()->getLanguages() as $language) {
// title
'com.woltlab.wcf.article.content',
0
);
+
+ $disallowedBBCodes = $this->htmlInputProcessors[$language->languageID]->validate();
+ if (!empty($disallowedBBCodes)) {
+ WCF::getTPL()->assign('disallowedBBCodes', $disallowedBBCodes);
+ throw new UserInputException('content', 'disallowedBBCodes');
+ }
}
} else {
// title
$this->htmlInputProcessors[0] = new HtmlInputProcessor();
$this->htmlInputProcessors[0]->process($this->content[0], 'com.woltlab.wcf.article.content', 0);
+
+ $disallowedBBCodes = $this->htmlInputProcessors[0]->validate();
+ if (!empty($disallowedBBCodes)) {
+ WCF::getTPL()->assign('disallowedBBCodes', $disallowedBBCodes);
+ throw new UserInputException('content', 'disallowedBBCodes');
+ }
}
$this->validateLabelIDs();
}
}
}
+
+ $this->setDisallowedBBCodes();
}
/**
'labelGroupsToCategories' => $this->labelGroupsToCategories,
]);
}
+
+ protected function setDisallowedBBCodes(): void
+ {
+ BBCodeHandler::getInstance()->setDisallowedBBCodes(
+ \explode(
+ ',',
+ WCF::getSession()->getPermission('user.message.disallowedBBCodes')
+ )
+ );
+ }
}