Decode the config file, and escape "define_"d strings.
authorAdam Sampson <ats@offog.org>
Thu, 9 Apr 2009 11:15:57 +0000 (11:15 +0000)
committerAdam Sampson <ats@offog.org>
Thu, 9 Apr 2009 11:15:57 +0000 (11:15 +0000)
NEWS
rawdoglib/rawdog.py

diff --git a/NEWS b/NEWS
index 855ae85f19a786483098483bb5d6838b7428228d..396f60e81545b9304013e6f4d845e031fb5f93c0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,10 @@ twenty or so of my feeds (reported by Joseph Reagle).
 Make the code that cleans up feedparser's return value more thorough --
 in particular, turn subclasses of "unicode" into real unicode objects.
 
+Decode the config file from the system encoding, and escape "define_"d
+strings when they're written to the output file (reported by Cristian
+Rigamonti).
+
 - rawdog 2.12
 
 Make rawdog work with Python 2.6 (reported by Roy Lanek).
index eef5707b36f4619ec4985f013399995f71d82106..749af97d825257ef4a570064ac9dd03c634ca5ab 100644 (file)
@@ -709,7 +709,7 @@ class Config:
                try:
                        f = open(filename, "r")
                        for line in f.xreadlines():
-                               stripped = line.strip()
+                               stripped = line.decode(get_system_encoding()).strip()
                                if stripped == "" or stripped[0] == "#":
                                        continue
                                if line[0] in string.whitespace:
@@ -1307,7 +1307,7 @@ __description__
                itembits = {}
                for name, value in feed.args.items():
                        if name.startswith("define_"):
-                               itembits[name[7:]] = value
+                               itembits[name[7:]] = sanitise_html(value, "", True, config)
 
                title = detail_to_html(entry_info.get("title_detail"), True, config)