Show More
@@ -7,7 +7,6 b'' | |||||
7 |
|
7 | |||
8 | from __future__ import absolute_import |
|
8 | from __future__ import absolute_import | |
9 |
|
9 | |||
10 | import cgi |
|
|||
11 | import copy |
|
10 | import copy | |
12 | import mimetypes |
|
11 | import mimetypes | |
13 | import os |
|
12 | import os | |
@@ -38,6 +37,7 b' from .. import (' | |||||
38 | smartset, |
|
37 | smartset, | |
39 | templatefilters, |
|
38 | templatefilters, | |
40 | templater, |
|
39 | templater, | |
|
40 | url, | |||
41 | util, |
|
41 | util, | |
42 | ) |
|
42 | ) | |
43 |
|
43 | |||
@@ -1250,9 +1250,9 b' def graph(web, req, tmpl):' | |||||
1250 | node = str(ctx) |
|
1250 | node = str(ctx) | |
1251 | age = encodestr(templatefilters.age(ctx.date())) |
|
1251 | age = encodestr(templatefilters.age(ctx.date())) | |
1252 | desc = templatefilters.firstline(encodestr(ctx.description())) |
|
1252 | desc = templatefilters.firstline(encodestr(ctx.description())) | |
1253 |
desc = |
|
1253 | desc = url.escape(templatefilters.nonempty(desc)) | |
1254 |
user = |
|
1254 | user = url.escape(templatefilters.person(encodestr(ctx.user()))) | |
1255 |
branch = |
|
1255 | branch = url.escape(encodestr(ctx.branch())) | |
1256 | try: |
|
1256 | try: | |
1257 | branchnode = web.repo.branchtip(branch) |
|
1257 | branchnode = web.repo.branchtip(branch) | |
1258 | except error.RepoLookupError: |
|
1258 | except error.RepoLookupError: | |
@@ -1261,8 +1261,8 b' def graph(web, req, tmpl):' | |||||
1261 |
|
1261 | |||
1262 | if usetuples: |
|
1262 | if usetuples: | |
1263 | data.append((node, vtx, edges, desc, user, age, branch, |
|
1263 | data.append((node, vtx, edges, desc, user, age, branch, | |
1264 |
[ |
|
1264 | [url.escape(encodestr(x)) for x in ctx.tags()], | |
1265 |
[ |
|
1265 | [url.escape(encodestr(x)) | |
1266 | for x in ctx.bookmarks()])) |
|
1266 | for x in ctx.bookmarks()])) | |
1267 | else: |
|
1267 | else: | |
1268 | edgedata = [{'col': edge[0], 'nextcol': edge[1], |
|
1268 | edgedata = [{'col': edge[0], 'nextcol': edge[1], |
@@ -20,13 +20,13 b' when adding support for new constructs.' | |||||
20 |
|
20 | |||
21 | from __future__ import absolute_import |
|
21 | from __future__ import absolute_import | |
22 |
|
22 | |||
23 | import cgi |
|
|||
24 | import re |
|
23 | import re | |
25 |
|
24 | |||
26 | from .i18n import _ |
|
25 | from .i18n import _ | |
27 | from . import ( |
|
26 | from . import ( | |
28 | encoding, |
|
27 | encoding, | |
29 | pycompat, |
|
28 | pycompat, | |
|
29 | url, | |||
30 | util, |
|
30 | util, | |
31 | ) |
|
31 | ) | |
32 |
|
32 | |||
@@ -552,7 +552,7 b' def formathtml(blocks):' | |||||
552 | listnest = [] |
|
552 | listnest = [] | |
553 |
|
553 | |||
554 | def escape(s): |
|
554 | def escape(s): | |
555 |
return |
|
555 | return url.escape(s, True) | |
556 |
|
556 | |||
557 | def openlist(start, level): |
|
557 | def openlist(start, level): | |
558 | if not listnest or listnest[-1][0] != start: |
|
558 | if not listnest or listnest[-1][0] != start: |
@@ -7,7 +7,6 b'' | |||||
7 |
|
7 | |||
8 | from __future__ import absolute_import |
|
8 | from __future__ import absolute_import | |
9 |
|
9 | |||
10 | import cgi |
|
|||
11 | import os |
|
10 | import os | |
12 | import re |
|
11 | import re | |
13 | import time |
|
12 | import time | |
@@ -19,6 +18,7 b' from . import (' | |||||
19 | pycompat, |
|
18 | pycompat, | |
20 | registrar, |
|
19 | registrar, | |
21 | templatekw, |
|
20 | templatekw, | |
|
21 | url, | |||
22 | util, |
|
22 | util, | |
23 | ) |
|
23 | ) | |
24 |
|
24 | |||
@@ -128,7 +128,7 b' def escape(text):' | |||||
128 | """Any text. Replaces the special XML/XHTML characters "&", "<" |
|
128 | """Any text. Replaces the special XML/XHTML characters "&", "<" | |
129 | and ">" with XML entities, and filters out NUL characters. |
|
129 | and ">" with XML entities, and filters out NUL characters. | |
130 | """ |
|
130 | """ | |
131 |
return |
|
131 | return url.escape(text.replace('\0', ''), True) | |
132 |
|
132 | |||
133 | para_re = None |
|
133 | para_re = None | |
134 | space_re = None |
|
134 | space_re = None |
General Comments 0
You need to be logged in to leave comments.
Login now