Mercurial > kallithea
changeset 2111:122f15a8f6ec beta
fixed issue with escaping < and > in changeset commits
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 07 Mar 2012 05:26:33 +0200 |
parents | bc24ef53edd1 |
children | 1477e048292e |
files | docs/changelog.rst rhodecode/lib/helpers.py |
diffstat | 2 files changed, 16 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/changelog.rst Wed Mar 07 05:15:33 2012 +0200 +++ b/docs/changelog.rst Wed Mar 07 05:26:33 2012 +0200 @@ -26,6 +26,7 @@ - fixed #390 cache invalidation problems on repos inside group - fixed #385 clone by ID url was loosing proxy prefix in URL - fixed some unicode problems with waitress +- fixed issue with escaping < and > in changeset commits 1.3.3 (**2012-03-02**) ----------------------
--- a/rhodecode/lib/helpers.py Wed Mar 07 05:15:33 2012 +0200 +++ b/rhodecode/lib/helpers.py Wed Mar 07 05:26:33 2012 +0200 @@ -802,6 +802,12 @@ def urlify_changesets(text_, repository): + """ + Extract revision ids from changeset and make link from them + + :param text_: + :param repository: + """ import re URL_PAT = re.compile(r'([0-9a-fA-F]{12,})') @@ -839,10 +845,10 @@ """ import re import traceback - - # urlify changesets - text_ = urlify_changesets(text_, repository) - + + def escaper(string): + return string.replace('<', '<').replace('>', '>') + def linkify_others(t, l): urls = re.compile(r'(\<a.*?\<\/a\>)',) links = [] @@ -853,6 +859,11 @@ links.append(e) return ''.join(links) + + + # urlify changesets - extrac revisions and make link out of them + text_ = urlify_changesets(escaper(text_), repository) + try: conf = config['app_conf']