From:  pear-qa@lists.php.net ("pasel@blueend.com")
Date:  22 Jan 2017 03:10:48 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #21168 [Com]: Cannot use string offset as an array in /usr/share/pear/XML/RSS.php:355

NNTP-Posting-Host:  null

Edit report at https://pear.php.net/bugs/bug.php?id=21168&edit=1

 ID:               21168
 Comment by:       pasel@blueend.com
 Reported By:      pasel at blueend dot com
 Summary:          Cannot use string offset as an array in
                    /usr/share/pear/XML/RSS.php:355
 Status:           Open
 Type:             Bug
 Package:          XML_RSS
 Operating System: Linux
 Package Version:  1.1.0a1
 PHP Version:      5.6.30
 Roadmap Versions: 
 New Comment:

I have added a pull request which is fixing the problem for me:

https://github.com/pear/XML_RSS/pull/5


Previous Comments:
------------------------------------------------------------------------

[2017-01-21 13:39:27] phroggar

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:
--------------
Fatal error:  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, '_parseString('parse()
#4 {main}
  thrown in /usr/share/pear/XML/RSS.php on line 282
Fatal error: 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, '_parseString('parse() #5 {main} thrown in /usr/share/pear/XML/RSS.php on line 355
------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=21168&edit=1