comparison mercurial/hgweb.py @ 1650:f2ebd5251e88

changed template escape filter, added urlescape filter; audited all templates for insertion bugs; added note to manifest.py about newlines in filenames
author Peter van Dijk <peter@dataloss.nl>
date Sun, 29 Jan 2006 00:18:52 +0100
parents beb7da710c8a
children e8a3df8b62b3
comparison
equal deleted inserted replaced
1649:beb7da710c8a 1650:f2ebd5251e88
4 # Copyright 2005 Matt Mackall <mpm@selenic.com> 4 # Copyright 2005 Matt Mackall <mpm@selenic.com>
5 # 5 #
6 # This software may be used and distributed according to the terms 6 # This software may be used and distributed according to the terms
7 # of the GNU General Public License, incorporated herein by reference. 7 # of the GNU General Public License, incorporated herein by reference.
8 8
9 import os, cgi, sys 9 import os, cgi, sys, urllib
10 from demandload import demandload 10 from demandload import demandload
11 demandload(globals(), "mdiff time re socket zlib errno ui hg ConfigParser") 11 demandload(globals(), "mdiff time re socket zlib errno ui hg ConfigParser")
12 demandload(globals(), "zipfile tempfile StringIO tarfile BaseHTTPServer util") 12 demandload(globals(), "zipfile tempfile StringIO tarfile BaseHTTPServer util")
13 demandload(globals(), "mimetypes") 13 demandload(globals(), "mimetypes")
14 from node import * 14 from node import *
161 else: 161 else:
162 yield tmpl 162 yield tmpl
163 return 163 return
164 164
165 common_filters = { 165 common_filters = {
166 "escape": cgi.escape, 166 "escape": lambda x: cgi.escape(x, True),
167 "urlescape": urllib.quote,
167 "strip": lambda x: x.strip(), 168 "strip": lambda x: x.strip(),
168 "age": age, 169 "age": age,
169 "date": lambda x: util.datestr(x), 170 "date": lambda x: util.datestr(x),
170 "addbreaks": nl2br, 171 "addbreaks": nl2br,
171 "obfuscate": obfuscate, 172 "obfuscate": obfuscate,