\XF\Entity\Thread::getCoverUrl() may cause undefined array key

XF\Entity\CoverImageTrait::getCoverImageInternal()

PHP:

Код:
/** @var Attachment $attachment */
if ($embeddedAttachments[$attachment->attachment_id])
{
    continue;
}

This calls \XF\Mvc\AbstractCollection::offsetGet()
PHP:

Код:
public function offsetGet($key): ?Entity
{
    return $this->entities[$key];
}

As can be seen, this directly accesses the internal array without checking if the key exists, so if it does not exist this generates a warning Undefined array key ......

Read more

Читать далее...
 
Активность
Пока что здесь никого нет
Назад
Верх Низ