Page 2 of 2

Re: Published Articles RSS feed does not display some caract

Posted: 29 Apr 2013, 16:43
by Monfreid
fox wrote:Give donation to simplepie developers so their feed library would stop fucking up the content on import. Read the FAQ entry one. In red.


ok, fair enough. Thanks
I have reported the issue to them and hopefully they will fix it and that will be beneficial to many and not just me :-)

Re: Published Articles RSS feed does not display some caract

Posted: 29 Apr 2013, 17:00
by fox
https://github.com/gothfox/Tiny-Tiny-RS ... a99a1d1a2f

This is very much experimental and may break things.

Re: Published Articles RSS feed does not display some caract

Posted: 30 Apr 2013, 13:32
by Monfreid
Thanks for this Fox, I will try this fix and hopefully it will fix my problem :-)

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 16:31
by Athanasius
fox wrote:https://github.com/gothfox/Tiny-Tiny-RSS/commit/39ede9862f1df94b24cbe476ec66eca99a1d1a2f

This is very much experimental and may break things.

I've just run into a problem that might be related to this. I first saw this at commit e57a1507aeb349c9ba7d673048c5ccb43e2d639b but to be sure I wasn't reporting something already fixed just updated to 7fc041c6ef2241d0611afb60fb721568376cd723 and still see the issue.

Feed: http://syndication.thedailywtf.com/TheDailyWtf

Look at the current latest article:

Code: Select all

                        <author>Erik Gern</author>
                        <title>CodeSOD: Re-Inventing the Alphabet</title>
                        <link>http://thedailywtf.com/Articles/ReInventing-the-Alphabet.aspx</link>
                        <category>CodeSOD</category>
                        <pubDate>Wed, 01 May 2013 10:30:00 GMT</pubDate>


it contains a code snippet with a for loop that contains a less-than character:

Code: Select all

public static string GenerateFilename()
{
    string valid_chars = "abcdefgijkmnopqrstwxyz1234567890";
    string temp = string.Empty;
    Random r = new Random();
    for (int i = 0; i < 5; i++)
        temp += valid_chars[r.Next(valid_chars.Length)];
    return temp;
}


In the raw feed this is:

Code: Select all

&lt;pre&gt;
public static string GenerateFilename()
{
    string valid_chars = "abcdefgijkmnopqrstwxyz1234567890";
    string temp = string.Empty;
    Random r = new Random();
    for (int i = 0; i &lt; 5; i++)
        temp += valid_chars[r.Next(valid_chars.Length)];
    return temp;
}
&lt;/pre&gt;


But in the tt-rss display of the article this pre-formatted section gets cut off:

Code: Select all

public static string GenerateFilename()
{
    string valid_chars = "abcdefgijkmnopqrstwxyz1234567890";
    string temp = string.Empty;
    Random r = new Random();
    for (int i = 0; i


although the article continues OK after the </pre>.

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 16:41
by fox
If you actually look at the changeset above you'll notice that it only concerns entry title.

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 16:42
by Athanasius
Would you like me to open a new issue for this then ?

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 18:04
by fox
See FAQ entry 1.

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 19:12
by Athanasius
Fair enough. Although for the benefit of others, don't think that just because the content of an article made it into your database OK (it did for my example when I checked) this means SimplePie is off the hook. It took me some time to spot that classes/feeds.php does end up calling sanitize() on the content in combined feed display mode and that sanitize() is part of SimplePie, i.e. it's used not only when fetching and parsing feeds to store but also as part of the display code in this instance.

I'll go poke the SimplePie people.

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 19:17
by fox
>the content of an article made it into your database OK

Why am I not seeing anything about this in the above post?

>and that sanitize() is part of SimplePie,

Actually, it's not.

Please learn to express yourself coherently, I don't have time to squeeze people for information.

Re: Published Articles RSS feed does not display some caract

Posted: 01 May 2013, 19:25
by Athanasius
Hang on, no, the sanitize() it calls has 4 arguments, that makes it the one in include/functions.php starting line 2700. If I remove the call to this in classes/feeds.php line 520, making it instead:

Code: Select all

$line["content"] = $line["content_preview"]

then the article displays without issues.

Re: Published Articles RSS feed does not display some caract

Posted: 13 May 2013, 15:47
by Monfreid
Monfreid wrote:Thanks for this Fox, I will try this fix and hopefully it will fix my problem :-)


Hi Fox,

I've tried your fix the other day and it didn't work but now it seems to work as if it needed a bit of time to be effective.
I have 2 instances of tt-rss, one with the fix and the other one without and I can see the difference, titles that have 2 or ' are now showing correct in the Published Articles feed.

Monfreid wrote:Maybe there is not a lot of people using the published articles feeds but I'm one of them and I use them intensively in Google Reader for my 2 websites. without this, maintaining my websites will be much more difficult. These websites generates some revenue (not a lot) to me so having this working would be great. I would give a donation for the fix


Donation on the way ... (not a lot but you can have a few beers on me :D )

Thanks a lot for all your hard work on this reader!

Re: Published Articles RSS feed does not display some caract

Posted: 13 May 2013, 16:05
by fox
Thanks. As far as I remember, the content was mangled on import, so it would only apply on newly imported articles.