]> granicus.if.org Git - cgit/commitdiff
ui-shared: URL-escape script_name
authorJohn Keeping <john@keeping.me.uk>
Sun, 12 Jan 2014 19:45:16 +0000 (19:45 +0000)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 12 Jan 2014 22:02:19 +0000 (23:02 +0100)
As far as I know, there is no requirement that $SCRIPT_NAME contain only
URL-safe characters, so we need to make sure that any special characters
are escaped.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-shared.c

index 2c12de73d7cea9885f31fa58e0b5b325088b436e..abe15cdaee8eb3e1986a0a740caf1ad0b7eb83ad 100644 (file)
@@ -139,7 +139,7 @@ static void site_url(const char *page, const char *search, const char *sort, int
        if (ctx.cfg.virtual_root)
                html_attr(ctx.cfg.virtual_root);
        else
-               html(ctx.cfg.script_name);
+               html_url_path(ctx.cfg.script_name);
 
        if (page) {
                htmlf("?p=%s", page);
@@ -219,7 +219,7 @@ static char *repolink(const char *title, const char *class, const char *page,
                                html_url_path(path);
                }
        } else {
-               html(ctx.cfg.script_name);
+               html_url_path(ctx.cfg.script_name);
                html("?url=");
                html_url_arg(ctx.repo->url);
                if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/')