all repos — cgit @ a45030f8ee10bc97ffcf1bf0061a2e6f22c7252a

a hyperfast web frontend for git written in c

ui-shared: URL-escape script_name

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>
John Keeping john@keeping.me.uk
Sun, 12 Jan 2014 19:45:16 +0000
commit

a45030f8ee10bc97ffcf1bf0061a2e6f22c7252a

parent

d1a6ece439e651a5b4ca535850e1c471f61c472e

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M ui-shared.cui-shared.c

@@ -139,7 +139,7 @@

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 @@ if (path)

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] != '/')