News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

RSS Feed Length Bug: Splits entities at the end of the string

Started by Vramin, December 22, 2005, 12:00:23 PM

Previous topic - Next topic

Vramin

I have tried my best to search and see if this has been reported, but the damn Google based search is very unfriendly, so I'm going to risk posting a duplicate and suffer the consequences if I have. Also, this was my best guess on which forum to report a bug on...

Anyway, I noticed that when you use the RSS feed, if you have set the maxlen to, say, 255 (the default), if the post being displayed happens to split off the end of an entity (like 9 for the apostrophe), then the XML goes out in an invalid format. The settings tell you that using 0 to return the whole post is a "bad idea," but it looks like the only option short of breaking your feed. I've had it happen more than a few times, so I don't consider it a boundary condition anymore. I've edited posts to fix it before, but I just shouldn't have to.

I didn't have time to try coding a fix yet, but it needs to look at the last few characters in the substring to see if there's a # in there and bump the length until it sees the ; before returning.

This is in SMF 1.1 RC1.1, Sources/News.php, function getXmlNews()

viulian

Exactly what you say - I have the same problem.

bottom: 0;"><li>sjnkjksjskjv</li><li>sjuskjnsn</li></ul>ahamm...deci po]]>&#039;<![CDATA[ sa scriu mai multe...pct de ved. <img src="http://new.lovetime.ro/Smileys/classic/wink.gif" alt="Wink" border="0" /><br /><br /><img src="http://aici ar fi trebuit sa inserez o imagine....:P" alt="" border="0" /><br /><br />in fine...nush]]>&#03...

The separator is cut in half :)

This happens with SMF 1.1 RC2.

tiwag

1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'

to SMF devs:
the above is a test-string which demonstrates the generation of a bogus rss-feed item,
because the <description> data is brutely cutted at 255 chars output
if around the 255th char a CDATA string is sent, all goes well,
but if any of the special chars tags are sent, the generated xml has a syntax error.

from the generated xml file
Quote

<description><![CDATA[1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890]]>&#...</description>



tiwag

here is a bugfix for this shameful bug

hxxp:tiwag.front.ru/smf/smf_1-1-rc2_rssfeedbugfix.zip [nonactive]



Advertisement: