mirror of
https://github.com/humhub/humhub.git
synced 2025-01-18 06:38:14 +01:00
Update CommentLink.php (#5277)
The 2 last conditions (after the `||`) should be wrapped in parenthesis
This commit is contained in:
parent
c7b43d6206
commit
dcde6f2282
@ -51,11 +51,20 @@ class CommentLink extends Widget
|
||||
/** @var Module $module */
|
||||
$module = Yii::$app->getModule('comment');
|
||||
|
||||
if (
|
||||
!$module->canComment($this->object)
|
||||
|| (
|
||||
CommentModel::isSubComment($this->object)
|
||||
&& !$module->canComment($this->object->content->getPolymorphicRelation())
|
||||
)
|
||||
){
|
||||
return '';
|
||||
}
|
||||
|
||||
if (empty($this->mode)) {
|
||||
$this->mode = self::MODE_INLINE;
|
||||
}
|
||||
|
||||
if ($module->canComment($this->object) || CommentModel::isSubComment($this->object) && $module->canComment($this->object->content->getPolymorphicRelation())){
|
||||
return $this->render('link', [
|
||||
'id' => $this->object->getUniqueId(),
|
||||
'mode' => $this->mode,
|
||||
@ -68,4 +77,3 @@ class CommentLink extends Widget
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user