Marcin Kuzminski avatar Marcin Kuzminski committed 122f15a

fixed issue with escaping < and > in changeset commits

Comments (0)

Files changed (2)

docs/changelog.rst

 - 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**)
 ----------------------

rhodecode/lib/helpers.py

 
 
 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,})')
 
     """
     import re
     import traceback
-
-    # urlify changesets
-    text_ = urlify_changesets(text_, repository)
-
+    
+    def escaper(string):
+        return string.replace('<', '&lt;').replace('>', '&gt;')
+    
     def linkify_others(t, l):
         urls = re.compile(r'(\<a.*?\<\/a\>)',)
         links = []
                 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']
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.