- Affected version
- 2.1.8
On edit gallery comment, called
If we look at commentPreparer we will see the missing argument:
When called, we do not have $this->performValidations.
Should be like that in Preparer:
setMessage();
PHP:
public function setMessage($message, $format = true)
{
if (!$this->comment->isChanged('message'))
{
$this->setupEditHistory();
}
return $this->commentPreparer->setMessage($message, $format, $this->performValidations);
}
PHP:
public function setMessage($message, $format = true)
{
$preparer = $this->getMessagePreparer($format);
$this->comment->message = $preparer->prepare($message);
$this->comment->embed_metadata = $preparer->getEmbedMetadata();
$this->quotedComments = $preparer->getQuotesKeyed('xfmg-comment');
$this->mentionedUsers = $preparer->getMentionedUsers();
return $preparer->pushEntityErrorIfInvalid($this->comment);
}
Should be like that in Preparer:
PHP:
public function setMessage($message, $format = true, $checkValidity = true)
{
$preparer = $this->getMessagePreparer($format);
$this->comment->message = $preparer->prepare($message, $checkValidity);
$this->comment->embed_metadata = $preparer->getEmbedMetadata();
$this->quotedComments = $preparer->getQuotesKeyed('xfmg-comment');
$this->mentionedUsers = $preparer->getMentionedUsers();
return $preparer->pushEntityErrorIfInvalid($this->comment);
}