• We have redone the forum. If you notice any issues or errors please open a Support Ticket under the Members dropdown and let us know.
K

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

  • Thread starter Thread starter Kirby
  • Start date Start date
K

Kirby

Guest

XF\Entity\CoverImageTrait::getCoverImageInternal()

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

This calls \XF\Mvc\AbstractCollection::offsetGet()
PHP:
Code:
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

Continue reading...
 
Similar threads Most view View more
Back
Top