Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templates/gitweb/changeset.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 | 52305554fd6e |
line wrap: on
line diff
--- a/mercurial/templates/gitweb/changeset.tmpl Fri Feb 01 15:14:05 2013 -0600 +++ b/mercurial/templates/gitweb/changeset.tmpl Fri Feb 01 20:43:35 2013 +0100 @@ -1,9 +1,9 @@ {header} <title>{repo|escape}: changeset {rev}:{node|short}</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,22 +13,22 @@ </div> <div class="page_nav"> -<a href="{url}summary{sessionvars%urlparameter}">summary</a> | -<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a> | -<a href="{url}log/{rev}{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}file/{node|short}{sessionvars%urlparameter}">files</a> | +<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> | +<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a> | +<a href="{url|urlescape}log/{rev}{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> | +<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> | changeset | -<a href="{url}raw-rev/{node|short}">raw</a> {archives%archiveentry} | -<a href="{url}help{sessionvars%urlparameter}">help</a> +<a href="{url|urlescape}raw-rev/{node|short}">raw</a> {archives%archiveentry} | +<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a> <br/> </div> <div> -<a class="title" href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a> +<a class="title" href="{url|urlescape}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a> </div> <div class="title_text"> <table cellspacing="0">