From: David-Sarah Hopwood Date: Thu, 25 Oct 2012 00:01:25 +0000 (+0100) Subject: src/allmydata/web/directory.py: fix HTML double-encoding issue for filenames. X-Git-Tag: allmydata-tahoe-1.10a1~49 X-Git-Url: https://git.rkrishnan.org/pf/content//%22%22?a=commitdiff_plain;h=1df7f114b7094dab8d7ffea8b390b10c0070b0fd;p=tahoe-lafs%2Ftahoe-lafs.git src/allmydata/web/directory.py: fix HTML double-encoding issue for filenames. Nevow automatically HTML-escapes strings passed in stan without a raw marker. Written by MK_FG. fixes #1143 Signed-off-by: David-Sarah Hopwood --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 2483236d..d52ce676 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -6,11 +6,12 @@ from twisted.application import service from twisted.trial import unittest from twisted.internet import defer, reactor from twisted.internet.task import Clock -from twisted.web import client, error, http +from twisted.web import client, error, http, html from twisted.python import failure, log from foolscap.api import fireEventually, flushEventualQueue +from nevow.util import escapeToXML from nevow import rend from allmydata import interfaces, uri, webish, dirnode @@ -256,6 +257,16 @@ class WebMixin(object): _ign, n, blocking_uri = self.makefile(1) foo.set_uri(u"blockingfile", blocking_uri, blocking_uri) + # filenode to test for html encoding issues + self._htmlname_unicode = u"<&weirdly'named\"file>>>_