- Affected version
- 2.1.5
PHP:
public function revertToHistory(\XF\Entity\EditHistory $history, \XF\Mvc\Entity\Entity $content = null, \XF\EditHistory\AbstractHandler $handler = null)
{
$handler = $handler ?: $this->getEditHistoryHandler($history->content_type);
$content = $content ?: $handler->getContent($history->content_id);
...
if ($count && $handler->revertToVersion($content, $history, $previous))
There is no null check on
$content
to handle case where edit history has been added but not cleaned up correctly when the content is hard deleted.