Mercurial > hg
diff mercurial/templates/gitweb/error.tmpl @ 18526:9409aeaafdc1 stable
hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Without this, repository paths or names containing e.g. & characters or html
tags yielded strange results, possibly allowing cross-site scripting attacks.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 01 Feb 2013 20:43:35 +0100 |
parents | bebb05a7e249 |
children | 32f76eccbced |
line wrap: on
line diff
--- a/mercurial/templates/gitweb/error.tmpl Fri Feb 01 15:14:05 2013 -0600 +++ b/mercurial/templates/gitweb/error.tmpl Fri Feb 01 20:43:35 2013 +0100 @@ -1,9 +1,9 @@ {header} <title>{repo|escape}: Error</title> <link rel="alternate" type="application/atom+xml" - href="{url}atom-log" title="Atom feed for {repo|escape}"/> + href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/> <link rel="alternate" type="application/rss+xml" - href="{url}rss-log" title="RSS feed for {repo|escape}"/> + href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/> </head> <body> @@ -13,14 +13,14 @@ </div> <div class="page_nav"> -<a href="{url}summary{sessionvars%urlparameter}">summary</a> | -<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> | -<a href="{url}log{sessionvars%urlparameter}">changelog</a> | -<a href="{url}tags{sessionvars%urlparameter}">tags</a> | -<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> | -<a href="{url}branches{sessionvars%urlparameter}">branches</a> | -<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> | -<a href="{url}help{sessionvars%urlparameter}">help</a> +<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> | +<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> | +<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> | +<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> | +<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> | +<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> | +<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> | +<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a> <br/> </div>