Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.0

Bug #21168 Cannot use string offset as an array in /usr/share/pear/XML/RSS.php:355
Submitted: 2017-01-21 18:39 UTC
From: phroggar Assigned: ashnazg
Status: Closed Package: XML_RSS (version 1.1.0a1)
PHP Version: 5.6.30 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2017-01-21 18:39 UTC] phroggar (Stefan Pasel)
Description: ------------ PHP Version is 7.1 (Bugtracker dropdown stops at 5.6). Bug preset in stable and alpha. I'm currently checking compatibility of our code wrt PHP 7.1 and i noticed that some RSS feeds are not working anymore with XML_RSS. Example Feeds not working anymore: http://www.n-tv.de/23.rss http://www.handelsblatt.com/contentexport/feed/schlagzeilen http://www.spiegel.de/politik/index.rss Stacktrace is different depending on the feeds (Stacktraces below) Test script: --------------- include_once "XML/RSS.php"; $rss = new XML_RSS('http://www.n-tv.de/23.rss'); $rss->parse(); Actual result: -------------- <b>Fatal error</b>: Uncaught Error: Cannot use string offset as an array in /usr/share/pear/XML/RSS.php:282 Stack trace: #0 [internal function]: XML_RSS->endHandler(Resource id #7, 'ENCLOSURE') #1 /usr/share/pear/XML/Parser.php(526): xml_parse(Resource id #7, '<?xml version="...', false) #2 /usr/share/pear/XML/Parser.php(495): XML_Parser->_parseString('<?xml version="...', false) #3 /.../test.php(16): XML_Parser->parse() #4 {main} thrown in <b>/usr/share/pear/XML/RSS.php</b> on line <b>282</b><br /> Fatal error</b>: Uncaught Error: Cannot use string offset as an array in /usr/share/pear/XML/RSS.php:355 Stack trace: #0 /usr/share/pear/XML/RSS.php(313): XML_RSS->_add('item', 'category', 'Politik') #1 [internal function]: XML_RSS->cdataHandler(Resource id #7, 'Politik') #2 /usr/share/pear/XML/Parser.php(526): xml_parse(Resource id #7, '<?xml version="...', false) #3 /usr/share/pear/XML/Parser.php(495): XML_Parser->_parseString('<?xml version="...', false) #4 /.../test.php(16): XML_Parser->parse() #5 {main} thrown in <b>/usr/share/pear/XML/RSS.php</b> on line <b>355</b><br />

Comments

 [2017-01-21 19:10 UTC] phroggar (Stefan Pasel)
I have added a pull request which is fixing the problem for me: https://github.com/pear/XML_RSS/pull/5
 [2017-03-07 19:09 UTC] ashnazg (Chuck Burgess)
-Status: Open +Status: Assigned -Assigned To: +Assigned To: ashnazg
 [2017-03-07 19:11 UTC] ashnazg (Chuck Burgess)
-Status: Assigned +Status: Verified
 [2017-03-07 19:22 UTC] ashnazg (Chuck Burgess)
-Status: Verified +Status: Closed
Fixed in upcoming v1.1.0 release.