From 427f01032b64092bf3d1c73ee68c82fca9e1015f Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 1 Jun 2013 10:32:51 +0200 Subject: [PATCH] Factoids: Fix XHTML validation of the web interface. --- plugins/Factoids/plugin.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/Factoids/plugin.py b/plugins/Factoids/plugin.py index f52b8188d..b932747b4 100644 --- a/plugins/Factoids/plugin.py +++ b/plugins/Factoids/plugin.py @@ -83,7 +83,9 @@ addConverter('factoidId', getFactoidId) PAGE_SKELETON = """\ - + + + Factoids @@ -123,14 +125,14 @@ class FactoidsCallback(httpserver.SupyHTTPServerCallback): parts = path.split('/')[1:] if path == '/': self.send_response(200) - self.send_header('Content-type', 'text/html') + self.send_header('Content-type', 'text/html; charset=utf-8') self.end_headers() self.wfile.write(httpserver.get_template('factoids/index.html')) elif len(parts) == 2: channel = urllib.unquote(parts[0]) if not ircutils.isChannel(channel): self.send_response(404) - self.send_header('Content-type', 'text/html') + self.send_header('Content-type', 'text/html; charset=utf-8') self.end_headers() self.wfile.write(httpserver.get_template('generic/error.html')% {'title': 'Factoids - not a channel', @@ -138,7 +140,7 @@ class FactoidsCallback(httpserver.SupyHTTPServerCallback): return if not self._plugin.registryValue('web.channel', channel): self.send_response(403) - self.send_header('Content-type', 'text/html') + self.send_header('Content-type', 'text/html; charset=utf-8') self.end_headers() self.wfile.write(httpserver.get_template('generic/error.html')% {'title': 'Factoids - unavailable', @@ -171,7 +173,7 @@ class FactoidsCallback(httpserver.SupyHTTPServerCallback): content += '' content = content[:-len('')] self.send_response(200) - self.send_header('Content-type', 'text/html') + self.send_header('Content-type', 'text/html; charset=utf-8') self.end_headers() self.wfile.write(httpserver.get_template('factoids/channel.html')% {'channel': channel, 'rows': content}) @@ -183,7 +185,7 @@ class FactoidsCallback(httpserver.SupyHTTPServerCallback): self.end_headers() else: self.send_response(400) - self.send_header('Content-type', 'text/plain') + self.send_header('Content-type', 'text/plain; charset=utf-8') self.end_headers() self.wfile.write('Missing field \'chan\'.')