foreach ($feed as $entry)
{
/** @var $entry Zend_Feed_Reader_EntryInterface */
try
{
$content = $entry->getContent();
}
catch (Exception $e)
{
// there's a situation where getting the content can trigger an exception if malformed,
// so ensure this doesn't error
$content = $entry->getDescription();
}
$entryData = array(
'id' => $entry->getId(),
'title' => html_entity_decode($entry->getTitle(), ENT_COMPAT, 'utf-8'),
'description' => html_entity_decode($entry->getDescription(), ENT_COMPAT, 'utf-8'),
'date_modified' => null,
'authors' => $entry->getAuthors(),
'link' => $entry->getLink(),
'content_html' => $content
);
$enclosure = $entry->getEnclosure();
if ($enclosure)
{
$entryData['enclosure_url'] = $enclosure->url;
$entryData['enclosure_length'] = $enclosure->length;
$entryData['enclosure_type'] = $enclosure->type;
}
/** if (utf8_strlen($entryData['id']) > 250) change by Temexter 20190806**/
if (utf8_strlen($entryData['id']) > 500)
{
$entryData['id'] = md5(substr($entryData['id'], 0, 500));
/** $entryData['id'] = md5($entryData['id']); change by Temexter 20190806 **/
}
try
{
$entryData['date_modified'] = $entry->getDateModified();
}
catch (Zend_Exception $e) {} // triggered with invalid date format
if (!empty($entryData['date_modified']) && $entryData['date_modified'] instanceof Zend_Date)
{
$entryData['date_modified'] = $entryData['date_modified']->getTimeStamp();
}
else
{
$entryData['date_modified'] = XenForo_Application::$time;
}