files: escape special chars for metadata loading to prevent breaking url with chars like #, <.

- fixes #5672
This commit is contained in:
RhodeCode Admin 2021-12-17 08:24:00 +01:00
parent 86f1961de4
commit eb95462c1a

View file

@ -337,11 +337,13 @@ def files_breadcrumbs(repo_name, repo_type, commit_id, file_path, landing_ref_na
def files_url_data(request):
import urllib
matchdict = request.matchdict
if 'f_path' not in matchdict:
matchdict['f_path'] = ''
else:
matchdict['f_path'] = urllib.quote(matchdict['f_path'])
if 'commit_id' not in matchdict:
matchdict['commit_id'] = 'tip'