Mercurial > hg
diff mercurial/templates/monoblue/summary.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 | 3fc86f1c39d8 |
line wrap: on
line diff
--- a/mercurial/templates/monoblue/summary.tmpl Fri Feb 01 15:14:05 2013 -0600 +++ b/mercurial/templates/monoblue/summary.tmpl Fri Feb 01 20:43:35 2013 +0100 @@ -1,7 +1,7 @@ {header} <title>{repo|escape}: Summary</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} / summary</h1> - <form action="{url}log"> + <form action="{url|urlescape}log"> {sessionvars%hiddenformentry} <dl class="search"> <dt><label>Search: </label></dt> @@ -19,14 +19,14 @@ <ul class="page-nav"> <li class="current">summary</li> - <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li> - <li><a href="{url}log{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}shortlog{sessionvars%urlparameter}">shortlog</a></li> + <li><a href="{url|urlescape}log{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> @@ -42,27 +42,27 @@ <dd>{lastchange|rfc822date}</dd> </dl> - <h2><a href="{url}shortlog{sessionvars%urlparameter}">Changes</a></h2> + <h2><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">Changes</a></h2> <table> {shortlog} <tr class="light"> - <td colspan="4"><a class="list" href="{url}shortlog{sessionvars%urlparameter}">...</a></td> + <td colspan="4"><a class="list" href="{url|urlescape}shortlog{sessionvars%urlparameter}">...</a></td> </tr> </table> - <h2><a href="{url}tags{sessionvars%urlparameter}">Tags</a></h2> + <h2><a href="{url|urlescape}tags{sessionvars%urlparameter}">Tags</a></h2> <table> {tags} <tr class="light"> - <td colspan="3"><a class="list" href="{url}tags{sessionvars%urlparameter}">...</a></td> + <td colspan="3"><a class="list" href="{url|urlescape}tags{sessionvars%urlparameter}">...</a></td> </tr> </table> - <h2><a href="{url}bookmarks{sessionvars%urlparameter}">Bookmarks</a></h2> + <h2><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">Bookmarks</a></h2> <table> {bookmarks%bookmarkentry} <tr class="light"> - <td colspan="3"><a class="list" href="{url}bookmarks{sessionvars%urlparameter}">...</a></td> + <td colspan="3"><a class="list" href="{url|urlescape}bookmarks{sessionvars%urlparameter}">...</a></td> </tr> </table>