Fixed RSS Feed Error PHP7.2RC2 and XF 1.5.15

Affected version


Well-known member

Using the above RSS feed, I'm now getting errors on PHP7.2RC2 using XF 1.5.15

Stack Trace
ErrorException: count(): Parameter must be an array or an object that implements Countable - library/Zend/Feed/Reader/Entry/Rss.php:204
Generated By: Matt, 1 minute ago
Stack Trace
#0 /home/nginx/domains/ XenForo_Application::handlePhpError(2, 'count(): Parame...', '/home/nginx/dom...', 204, Array)
#1 /home/nginx/domains/ Zend_Feed_Reader_Entry_Rss->getAuthors()
#2 /home/nginx/domains/ XenForo_Model_Feed->getFeedData('http://travaux....')
#3 /home/nginx/domains/ XenForo_Model_Feed->importFeedData(Array)
#4 /home/nginx/domains/ XenForo_ControllerAdmin_Feed->actionImport()
#5 /home/nginx/domains/ XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/nginx/domains/ XenForo_FrontController->run()
#7 {main}
# php -v
PHP 7.2.0RC2 (cli) (built: Sep 26 2017 15:11:47) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0-dev, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.2.0RC2, Copyright (c) 1999-2017, by Zend Technologies

Chris D

XenForo developer
Staff member
Hmm, that would seem to be a Zend Framework bug for both versions. Obviously very little hope of getting it fixed in XF 1.5 but might be more viable in 2.0.

I need to update my PHP 7.2 build so once I've had a chance to test this I'll report back.

Chris D

XenForo developer
Staff member
We've fixed this for the next 1.5 release and confirmed that the same issue is not present in ZF2 (and therefore not in XF2).

It may be some time until the next 1.5 release (given that the current one took 3 months and even then was very small) so if you'd like to adjust this in the meantime then the fix is as follows.

Open the file library/Zend/Feed/Reader/Extension/Atom/Entry.php.

$authors = null;
Replace with:
$authors = array();


XenForo developer
Staff member
This is also pretty specific to the RSS feed -- notably, pretty sure it requires one that doesn't have any author data. But this will certainly effect quite a few less people than the Chrome regression (that causes issues that affect guests, registered users and moderators).