Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templatefilters.py @ 21867:829f2dd99f5c stable
templates: escape NUL bytes in jsonescape (issue4303)
It's currently possible for various fields to contain NUL bytes, which
are disallowed in JSON.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 14 Jul 2014 12:44:45 -0500 |
parents | e828975722c8 |
children | cf599f8a2da8 |
line wrap: on
line diff
--- a/mercurial/templatefilters.py Thu Jul 03 10:48:37 2014 +0100 +++ b/mercurial/templatefilters.py Mon Jul 14 12:44:45 2014 -0500 @@ -215,7 +215,7 @@ _escapes = [ ('\\', '\\\\'), ('"', '\\"'), ('\t', '\\t'), ('\n', '\\n'), ('\r', '\\r'), ('\f', '\\f'), ('\b', '\\b'), - ('<', '\\u003c'), ('>', '\\u003e') + ('<', '\\u003c'), ('>', '\\u003e'), ('\0', '\\u0000') ] def jsonescape(s):