History

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.

John Keeping committed 12 years ago

Commit a45030f1 parent d1a6ece1 file · +2 −2Browse files

Unified · Split

ui-shared.c+2−2
@@ -139,7 +139,7 @@ static void site_url(const char *page, const char *search, const char *sort, int · 138 unmodified lines
139139 if (ctx.cfg.virtual_root)
140140 html_attr(ctx.cfg.virtual_root);
141141 else
142− html(ctx.cfg.script_name);
142+ html_url_path(ctx.cfg.script_name);
143143
144144 if (page) {
145145 htmlf("?p=%s", page);
@@ -219,7 +219,7 @@ static char *repolink(const char *title, const char *class, const char *page, · 73 unmodified lines
219219 html_url_path(path);
220220 }
221221 } else {
222− html(ctx.cfg.script_name);
222+ html_url_path(ctx.cfg.script_name);
223223 html("?url=");
224224 html_url_arg(ctx.repo->url);
225225 if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/')