svn commit: samba-web r624 - in trunk/scripts: .

deryck at samba.org deryck at samba.org
Tue Apr 12 21:24:42 GMT 2005


Author: deryck
Date: 2005-04-12 21:24:41 +0000 (Tue, 12 Apr 2005)
New Revision: 624

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=624

Log:

Correct fix for RSS parsing errors caused by HTML encoded
characters -- replace all ampersands with '&'.

deryck

Modified:
   trunk/scripts/updateNews.py


Changeset:
Modified: trunk/scripts/updateNews.py
===================================================================
--- trunk/scripts/updateNews.py	2005-04-12 15:54:59 UTC (rev 623)
+++ trunk/scripts/updateNews.py	2005-04-12 21:24:41 UTC (rev 624)
@@ -192,15 +192,12 @@
 feed.write('<description>Latest news and happenings with Samba and Samba development.</description>\n')
 feed.write('<link>http://news.samba.org/</link>\n\n')
 
-# Characters to avoid as "undefined entities" in XML
-ents = { '&mdash;' : '--' }
-
 count = 10
 for date in post_dates:
     item_text = all_stories[date]
-    if '&' in item_text and ';' in item_text:
-        for ent in ents.keys():
-            item_text = item_text.replace(ent, ents[ent])
+    # Encode *all* ampersands
+    if '&' in item_text:
+            item_text = item_text.replace('&', '&amp;')
                 
     if count > 0:
         title = re.search('(?<=\"\>).+(?=\<\/a)', item_text)



More information about the samba-cvs mailing list