Mercurial > hg
diff mercurial/templates/gitweb/manifest.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 | dd89304687a3 |
line wrap: on
line diff
--- a/mercurial/templates/gitweb/manifest.tmpl Fri Feb 01 15:14:05 2013 -0600 +++ b/mercurial/templates/gitweb/manifest.tmpl Fri Feb 01 20:43:35 2013 +0100 @@ -1,9 +1,9 @@ {header} <title>{repo|escape}: files</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,16 +13,16 @@ </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}graph{sessionvars%urlparameter}">graph</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|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}graph{sessionvars%urlparameter}">graph</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> | files | -<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> {archives%archiveentry} | -<a href="{url}help{sessionvars%urlparameter}">help</a> +<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> {archives%archiveentry} | +<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a> <br/> </div> @@ -32,7 +32,7 @@ <td style="font-family:monospace">drwxr-xr-x</td> <td style="font-family:monospace"></td> <td style="font-family:monospace"></td> -<td><a href="{url}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td> +<td><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td> <td class="link"> </td> </tr> {dentries%direntry}