Fixed ConversationMaster::canView returns true, or throws an exception

Xon

Well-known member
Affected version
2.1.7
PHP:
public function canView(&$error = null)
{
   $visitor = \XF::visitor();
   return $this->Users[$visitor->user_id] ? true : false;
}

If the visitor user id is not part of Users, then AbstractCollection will throw "Undefined offset" instead of returning false.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.8).

Change log:
Ensure a boolean value is returned when checking viewing permissions for conversations.
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom