Ad a new "Module Feed Display" and set as Feed URL: http://www.google.com/robots.txt
Message "Feed not available" in module position
Site crash
Warning: XMLReader::read(): An Error Occurred while reading in \libraries\joomla\feed\factory.php on line 71
Joomla 3.3.6 / Apache 2.4.4 / PHP 5.5.3 / MySQL 5.6.11
We include a newsfeed which is sometimes down. In this case the feed-server returns a page with text/plain content - and our site crashes.
It makes no difference to include feed via module or via News Feed Manager.
With the same faulty link as above in the newsfeed component view on the frontend i got a different error
Fatal error: Maximum execution time of 30 seconds exceeded in /Applications/MAMP/htdocs/Joomla_3.4.0-beta1-Beta-Full_Package/libraries/joomla/feed/factory.php on line 72
In the module view I get
Fatal error: Maximum execution time of 30 seconds exceeded in /Applications/MAMP/htdocs/Joomla_3.4.0-beta1-Beta-Full_Package/libraries/joomla/feed/factory.php on line 69
Status | New | ⇒ | Confirmed |
Labels |
Added:
?
|
The loop where this read error occurs appears to be the issue. When a non-XML document is read, the while loop never terminates, and it appears the XMLReader class continues to allocate memory until something like this eventually occurs:
PHP Fatal error: Allowed memory size of 205520896 bytes exhausted (tried to allocate 179834881 bytes) in /home/usr/public_html/libraries/joomla/feed/factory.php
I do not believe the XMLReader class is being used properly.
The fix is to change the loop from:
do
{
$reader->read();
}
while ($reader->nodeType !== XMLReader::ELEMENT);
to something like this:
while ($reader->read())
{
if ($reader->nodeType == XMLReader::ELEMENT)
{
break;
}
}
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="http://issues.joomla.org/tracker/joomla-cms/5939">issues.joomla.org/joomla-cms/5939</a>.</sub>
Closing as we have a PR by @DannyBoyk here: #6980 Thanks
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-18 15:12:43 |
Closed_By | ⇒ | zero-24 | |
Build | 3.3.6 | ⇒ | staging |
Thanks DannyBoyk
it worked like wonders
keep doing good work
Confirmed.