Mercurial > hg
diff mercurial/templates/monoblue/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/monoblue/changeset.tmpl Fri Feb 01 15:14:05 2013 -0600 +++ b/mercurial/templates/monoblue/changeset.tmpl Fri Feb 01 20:43:35 2013 +0100 @@ -1,7 +1,7 @@ {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}"/> - <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/> + <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/> + <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/> </head> <body> @@ -9,7 +9,7 @@ <div class="page-header"> <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset</h1> - <form action="{url}log"> + <form action="{url|urlescape}log"> {sessionvars%hiddenformentry} <dl class="search"> <dt><label>Search: </label></dt> @@ -18,26 +18,26 @@ </form> <ul class="page-nav"> - <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li> - <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li> - <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li> - <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li> - <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li> - <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li> - <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li> - <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li> - <li><a href="{url}help{sessionvars%urlparameter}">help</a></li> + <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li> + <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li> + <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li> + <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li> + <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li> + <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li> + <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li> + <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li> + <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li> </ul> </div> <ul class="submenu"> <li class="current">changeset</li> - <li><a href="{url}raw-rev/{node|short}">raw</a> {archives%archiveentry}</li> + <li><a href="{url|urlescape}raw-rev/{node|short}">raw</a> {archives%archiveentry}</li> </ul> <h2 class="no-link no-border">changeset</h2> - <h3 class="changeset"><a href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3> + <h3 class="changeset"><a 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></h3> <p class="changeset-age age">{date|rfc822date}</p> <dl class="overview">