- Affected version
- 2.1.8
PHP:
public function checkValidity($message)
{
$isValid = parent::checkValidity($message);
/** @var \XF\BbCode\ProcessorAction\AnalyzeUsage $usage */
$usage = $this->bbCodeProcessor->getAnalyzer('usage');
if ($this->isValid)
{
$maxImages = $this->constraints['maxImages'];
if ($maxImages && $usage->getTagCount('img') + $usage->getTagCount('gallery') > $maxImages)
{
$this->errors[] = \XF::phraseDeferred(
'please_enter_message_with_no_more_than_x_images',
['count' => $maxImages]
);
$this->isValid = false;
}
}
return $this->isValid;
}
if ($maxImages && $usage->getTagCount('img') + $usage->getTagCount('gallery') > $maxImages)
And dead variable $isValid.
Last edited: