]> granicus.if.org Git - cgit/commitdiff
ui-atom: properly escape delimiter in page link
authorJohn Keeping <john@keeping.me.uk>
Sun, 15 Jan 2017 12:29:38 +0000 (12:29 +0000)
committerLukas Fleischer <lfleischer@lfos.de>
Thu, 10 Aug 2017 13:15:54 +0000 (15:15 +0200)
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>
ui-atom.c

index 41838d38b7acb2381dd17e509e330da6678e452c..3866823b4baff1401b65ffb5987fc09e652b2963 100644 (file)
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -63,7 +63,7 @@ static void add_entry(struct commit *commit, const char *host)
                html_attr(pageurl);
                if (ctx.cfg.virtual_root)
                        delim = '?';
-               htmlf("%cid=%s", delim, hex);
+               html_attrf("%cid=%s", delim, hex);
                html("'/>\n");
                free(pageurl);
        }