##// END OF EJS Templates
url-parsing: fix for bug #5218, remove not allowed chars from uri...
Bartłomiej Wołyńczyk -
r1452:7515faca default
parent child Browse files
Show More
@@ -515,6 +515,16 b' def age(prevdate, now=None, show_short_v'
515 515 return _(u'just now')
516 516
517 517
518 def cleaned_uri(uri):
519 """
520 Quotes '[' and ']' from uri if there is only one of them.
521 according to RFC3986 we cannot use such chars in uri
522 :param uri:
523 :return: uri without this chars
524 """
525 return urllib.quote(uri, safe='@$:/')
526
527
518 528 def uri_filter(uri):
519 529 """
520 530 Removes user:password from given url string
@@ -53,7 +53,7 b' from rhodecode.lib.vcs.backends.base imp'
53 53 from rhodecode.lib.utils2 import (
54 54 str2bool, safe_str, get_commit_safe, safe_unicode, md5_safe,
55 55 time_to_datetime, aslist, Optional, safe_int, get_clone_url, AttributeDict,
56 glob2re, StrictAttributeDict)
56 glob2re, StrictAttributeDict, cleaned_uri)
57 57 from rhodecode.lib.jsonalchemy import MutationObj, MutationList, JsonType
58 58 from rhodecode.lib.ext_json import json
59 59 from rhodecode.lib.caching_query import FromCache
@@ -1822,7 +1822,7 b' class Repository(Base, BaseModel):'
1822 1822 clone_uri = self.clone_uri
1823 1823 if clone_uri:
1824 1824 import urlobject
1825 url_obj = urlobject.URLObject(clone_uri)
1825 url_obj = urlobject.URLObject(cleaned_uri(clone_uri))
1826 1826 if url_obj.password:
1827 1827 clone_uri = url_obj.with_password('*****')
1828 1828 return clone_uri
General Comments 0
You need to be logged in to leave comments. Login now