From fa7ebf514aac9628a5fb24084dd563defd8532a6 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 15 Aug 2017 13:10:47 +0200 Subject: [PATCH] Fixed setting the list of disallowed bbcodes for comments --- .../templates/commentListAddComment.tpl | 4 ++++ .../manager/AbstractCommentManager.class.php | 14 ++++++++++++++ .../comment/manager/ICommentManager.class.php | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/com.woltlab.wcf/templates/commentListAddComment.tpl b/com.woltlab.wcf/templates/commentListAddComment.tpl index 79674c28ea..b820c55d08 100644 --- a/com.woltlab.wcf/templates/commentListAddComment.tpl +++ b/com.woltlab.wcf/templates/commentListAddComment.tpl @@ -10,6 +10,10 @@ data-disable-attachments="true" data-disable-media="true" > + + {* in-template call for full backwards-compatibility *} + {$commentList->getCommentManager()->setDisallowedBBCodes()} + {include file='wysiwyg'}
diff --git a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php index ffe563abf6..9bae5b60c3 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -2,6 +2,7 @@ namespace wcf\system\comment\manager; use wcf\data\comment\response\CommentResponse; use wcf\data\comment\Comment; +use wcf\system\bbcode\BBCodeHandler; use wcf\system\SingletonFactory; use wcf\system\WCF; @@ -62,6 +63,12 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme */ protected $permissionModEdit = ''; + /** + * permission name for the list of disallowed bbcodes + * @var string + */ + protected $permissionDisallowedBBCodes = 'user.comment.disallowedBBCodes'; + /** * @inheritDoc */ @@ -97,6 +104,13 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme return (WCF::getSession()->getPermission($this->permissionAddWithoutModeration) ? true : false); } + /** + * @inheritDoc + */ + public function setDisallowedBBCodes() { + BBCodeHandler::getInstance()->setDisallowedBBCodes(explode(',', WCF::getSession()->getPermission($this->permissionDisallowedBBCodes))); + } + /** * @inheritDoc */ diff --git a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php index 847eea4231..446fde87f7 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php @@ -142,4 +142,9 @@ interface ICommentManager { * @return boolean */ public function supportsReport(); + + /** + * Sets the list of disallowed bbcodes. + */ + public function setDisallowedBBCodes(); } -- 2.20.1