ZF-12453: Zend_Feed_Writer_Feed addAuthor() throwing exceptions
Description
Fatal error: Uncaught exception 'Zend_Feed_Exception' with message 'Invalid parameter: "name" must be a non-empty string value' ../library/Zend/Feed/Writer/Feed/FeedAbstract.php on line 122.
Once that's fixed we get another exception:
Fatal error: Uncaught exception 'Zend_Feed_Exception' with message 'Invalid parameter: "name" must be a non-empty string value' in ../library/Zend/Feed/Writer/Entry.php on line 119
This is due to code that won't ever work.
Patch
Change line 120 in Zend_Feed_Writer_Feed_FeedAbstract to:
if (empty($name) || !is_string($name)) {
AND
Change line 117 in Zend_Feed_Writer_Entry to:
if (empty($name) || !is_string($name)) {
Comments
Posted by Frank Brückner (frosch) on 2012-10-24T17:14:33.000+0000
I think this issue is related to the PHP version, because in version 5.3.6 there are no errors:
Posted by Frank Brückner (frosch) on 2012-10-24T17:16:43.000+0000
Add patches. (Unit tests already there.)
Posted by bullfrogblues (gerardroche) on 2012-10-25T13:14:39.000+0000
I'm using 5.4. But I think this code should never work. Maybe the new behaviour of 5.4 causes an exception rather than a hidden bug. http://php.net/manual/en/…
Posted by bullfrogblues (gerardroche) on 2012-10-25T13:15:44.000+0000
"As of PHP 5.4 string offsets have to either be integers or integer-like strings, otherwise a warning will be thrown. Previously an offset like "foo" was silently cast to 0." http://php.net/manual/en/…
Posted by Frank Brückner (frosch) on 2012-10-26T08:08:48.000+0000
Fix unit tests. (Replace "assertType")
Posted by Rob Allen (rob) on 2012-11-06T21:02:22.000+0000
Patch applied on trunk (25082) and release-1.12 (25083)