diff options
author | John Keeping | 2017-01-15 12:29:38 +0000 |
---|---|---|
committer | Jason A. Donenfeld | 2017-08-10 15:58:24 +0200 |
commit | 6d3c8bc37f6124c2193d66587079975d381aa435 (patch) | |
tree | ef6b49f3a8882a95a5e1f3fc64b41459b6dac4e7 | |
parent | git: update to v2.14 (diff) | |
download | cgit-6d3c8bc37f6124c2193d66587079975d381aa435.tar.gz cgit-6d3c8bc37f6124c2193d66587079975d381aa435.zip |
ui-atom: properly escape delimiter in page link
If the delimiter here is '&' then it needs to be escaped for inclusion in an attribute. Use html_attrf() to ensure that this happens (we know that hex won't need escaping, but this makes it clearer what's happening. Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | ui-atom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-atom.c b/ui-atom.c index 41838d3..3866823 100644 --- a/ui-atom.c +++ b/ui-atom.c | |||
@@ -63,7 +63,7 @@ static void add_entry(struct commit *commit, const char *host) | |||
63 | html_attr(pageurl); | 63 | html_attr(pageurl); |
64 | if (ctx.cfg.virtual_root) | 64 | if (ctx.cfg.virtual_root) |
65 | delim = '?'; | 65 | delim = '?'; |
66 | htmlf("%cid=%s", delim, hex); | 66 | html_attrf("%cid=%s", delim, hex); |
67 | html("'/>\n"); | 67 | html("'/>\n"); |
68 | free(pageurl); | 68 | free(pageurl); |
69 | } | 69 | } |