gravitystorm / blogs.osm.org

The new feed aggregator for OpenStreetMap
https://blogs.openstreetmap.org/
6 stars 17 forks source link

Wrong/missing encoding of ampersands in atom/rss feeds (perhaps a pluto issue?) #28

Open unriccio opened 7 years ago

unriccio commented 7 years ago

I got some kind of "XML Parsing Error: not well-formed" using my favourite feedreader. I see the same error also when opening the atom/rss feeds with firefox and chromium.

It seems it's because of a wrong re-encoding (or missing encoding) of the ampersand symbol within links and guid. Example follows: (sorry it's a spam entry but I think the issue still applies)

Original feed:

riccio@hactar:/tmp$ wget -q http://www.openstreetmap.org/diary/rss -O - | fgrep Beer | egrep "(link|guid)"
      <link>http://www.openstreetmap.org/user/Harvest%20Moon%20Yakitori%20&amp;%20Beer%20Garden/diary/41379</link>
      <guid>http://www.openstreetmap.org/user/Harvest%20Moon%20Yakitori%20&amp;%20Beer%20Garden/diary/41379</guid>

Aggregator output:

riccio@hactar:/tmp$ wget -q https://blogs.openstreetmap.org/rss20.xml -O - | fgrep Beer | egrep "(link|guid)"
  <guid>http://www.openstreetmap.org/user/Harvest%20Moon%20Yakitori%20&%20Beer%20Garden/diary/41379</guid>
  <link>http://www.openstreetmap.org/user/Harvest%20Moon%20Yakitori%20&%20Beer%20Garden/diary/41379</link>
tomhughes commented 7 years ago

I think this pretty much has to be a pluto issue rather than anything we can fix here?

unriccio commented 7 years ago

Yeah, that's what I thought but I opened this issue the same so you would be aware of it (as it's making blogs.o.o feeds useless). Thanks.

geraldb commented 7 years ago

@unriccio Hello from Pluto. Thanks for reporting. Will look into the encoding of ampersands issue. Cheers.

geraldb commented 4 years ago

Sorry for the long wait. I finally got around to check in detail. The error is in the feed templates (in the openstreetmap) repo that are missing xml escapes (CGI::escape_HTML) for guid and link that turns "unescaped" & back into escaped &amp;. I will try to send in a pull request later in the next days. Again thanks for reporting the error. Keep it up. Stay healthy. Stay home. Wash hands.