Radio
Logging things done in Radio, or information on what to do


Categories:
Radio


Subscribe to "Radio" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.
 

 

Saturday, June 29, 2002
 

system.verbs.builtin.xml.rss.decodeString edited


I have edited system.verbs.builtin.xml.rss.decodeString to try to work around the double decoding bug.

  1. changed call to xml.decodeEntites to set flAlphaEntities to false. stop 2nd decoding of lt, gt, amp
  2. copy the line from xml.decodeEntities that handles quot entites back to xml.rss.decodeString since it is also controled by flAlphaEntities

I unsubscribed/resubscribed to my feed to force a re-parse of the RSS file, and not my code example shows up correctly in my aggregator.


1:39:09 AM    Categories: Radio

Double decoding in Radio's aggregator


The following is a post and a response to myself that I made in the Radio Userland Discussion Board about doulbe decoding in Radio's Aggregator. When pulling in an RSS feed, decoding for some entities is done when xml.compile breaks up the XML into a table internal to Radio and then again when xml.rss.decodeString calls xml.decodeEntity. The most glaring symptom of this is when a post in the RSS feed contains markup examples. These would be encoded with an amp entity followed by lt;,for exmaple, so that when the amp entity is decoded the result is an lt entity that ought to be displayed as a left angle bracket in the browser. Instead, the lt entity is caugt in the second decode and turns the code example for diplay into actuall markup, and likely messes up the whole page.

I can try to fix this by reaching into radio.root and changing things, but that will only last until the next update.

===

While from the comments in the script it looks like the additional decoding of entities in radio.html.viewNewsItems was removed on 5/31/02, it seems that there is still double decoding going on somehwere in xml.rss.compileService or something that it calls. I am noting this specifically with the feed for Dive into Mark which has had a lot of code examples lately.

The compilation.xmlstruct for a service looks like it has one pass of decoding already done to it (with the exception of "quot" entities) when compared to the actual RSS that has been compiled as well as to xmltext for the service. Does xml.compile, the only call between xmltext and xmlstruct, do any decoding of it's own? If so, compileService needs a decoder that will take cate of the quot but not lt, gt, and amp. If not, then I have no idea what could be doing this decoding.

===

Now that I've had time to try it out, I've that that xml.compile does in fact decode lt, gt, and amp entites (but not quot entities). I also made a feed, posted something with quoted entities for displayed markup, and then subscribed to myself to demonstrate that the problem is in fact with Radio's aggregator.

When making the outgoing RSS Radio sensibly runs the contents through xml.encode. However, when the aggregator pulls an incoming RSS feed it calls

1) xml.compile, which decodes any lt, gt, and amp entities, and then

2) xml.decode, which will then procede to decode any entities that now exist by virtue of amp entities having just been decoded.

This means that what originally were entities for diaply have been turned into markup by Radio's aggregator, resulting in Bad Things. Fixing this would require supplying xml.rss.compileService with a decode function that does NOT decode lt, gt, and amp functions since the call the xml.compile has already done this. The decode function would still need to decode quot entities.


1:26:06 AM    Categories: Radio



Click here to visit the Radio UserLand website. © Copyright 2002 Matthew Ernest.
Last update: 7/4/2002; 3:11:39 PM.
This theme is based on the SoundWaves (blue) Manila theme.
June 2002
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
May   Jul


radaR's LiveJournal 3:10PM PST
Bulletmelting...

BulletFootbridge

BulletIt's hot

BulletSynchronicity

BulletPractice to deceive