From 1df7f114b7094dab8d7ffea8b390b10c0070b0fd Mon Sep 17 00:00:00 2001 From: David-Sarah Hopwood Date: Thu, 25 Oct 2012 01:01:25 +0100 Subject: [PATCH] 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 --- src/allmydata/test/test_web.py | 83 +++++++++++++++++++++++----------- src/allmydata/web/directory.py | 13 ++---- 2 files changed, 62 insertions(+), 34 deletions(-) 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>>>_