? Success

User tests: Successful: Unsuccessful:

avatar pmleconte
pmleconte
9 Oct 2016

Pull Request for Issue #11106 .
#11106
This issue is closed, but the problem still exists in 3.6.2: it happened yesterday, http://feeds.joomla.org/JoomlaSecurityNews was not responding fast enough.

Summary of Changes

Uncatch error in feed factory
Error String could not be parsed as XML : this problem happens randomly

Testing Instructions

Create an incomplete feed and call it in a newsfeed module

avatar pmleconte pmleconte - open - 9 Oct 2016
avatar pmleconte pmleconte - change - 9 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2016
Category Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2016
Labels Added: ?
avatar pmleconte
pmleconte - comment - 9 Oct 2016

Copy the following file as test.rss and call it in a rss feed module

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
    <channel>
        <title>test.</title>
        <link>http://test.fr</link>
        <description>test.</description>
        <language>fr</language>

                <lastBuildDate>Fri, 07 Oct 2016 17:32:02 CEST</lastBuildDate>
        <item><title>test</title><description>Une vulnérabilité a été découverte dans Cisco IOS, Cisco IOS XE et Cisco IOS XR. Elle permet à un attaquant de provoquer une atteinte à la confidentialité des données.
    <atom:link href="http://test.rss" rel="self" type="application/rss+xml"/>
    </channel>
</rss>

It should cause error 0 - String could not be parsed as XML

Pascal

avatar pmleconte pmleconte - change - 9 Oct 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-10-09 09:58:20
Closed_By pmleconte
avatar pmleconte pmleconte - close - 9 Oct 2016
avatar pmleconte pmleconte - change - 9 Oct 2016
Status Closed New
Closed_Date 2016-10-09 09:58:20
Closed_By pmleconte
avatar pmleconte pmleconte - reopen - 9 Oct 2016
avatar brianteeman
brianteeman - comment - 9 Oct 2016

Did you mean to close this?

avatar brianteeman
brianteeman - comment - 9 Oct 2016

oops we posted at the same time

avatar pmleconte
pmleconte - comment - 9 Oct 2016

No, just messed up (I clicked on Close and comment ?????)

avatar mbabker
mbabker - comment - 9 Oct 2016

What's being gained here by catching and throwing a new exception? All you're basically doing is changing the error message, but it's also changing stack trace for the exception and to debug it one is going to have to be aware that it has a nested exception and dig into that. If there were some sort of additional layer of error handling it wouldn't be as big of an issue but catching and throwing a new exception honestly isn't a great practice.

avatar pmleconte
pmleconte - comment - 9 Oct 2016

I tried catching this error in different places with no success. If you find a better place or way of doing it, please let me know, because, when it happens, this error blows up my web sites.

avatar mbabker
mbabker - comment - 9 Oct 2016

Well if it's the feed module (either site or admin) that's making the request the only way it wouldn't catch it is if you're on PHP 7 and it's throwing something derived from the new Error object. If it's coming from the newsfeed component that isn't catching the base Exception class but only InvalidArgumentException and RuntimeException. Since creating a new SimpleXMLElement throws Exception if it has invalid XML I'd say change what the component's catching and see what happens.

If it really is the modules not catching the error, in the error.php template add a get_class($this->error) line and share that class name please.

avatar pmleconte
pmleconte - comment - 9 Oct 2016

OK, found it: I was using scrollfeed display module (http://appsnity.com/notification/joomla/23-scroll-feed-display.html) based on a old version of mod_feed (3.5.1). It's not catching all errors.

So, forget about this PR...

Pascal

avatar pmleconte pmleconte - change - 9 Oct 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-10-09 18:12:06
Closed_By pmleconte
avatar pmleconte pmleconte - close - 9 Oct 2016

Add a Comment

Login with GitHub to post a comment