From eb95462c1a3388ac875b1bb2100f5e982d9dbed3 Mon Sep 17 00:00:00 2001 From: RhodeCode Admin Date: Fri, 17 Dec 2021 08:24:00 +0100 Subject: [PATCH] files: escape special chars for metadata loading to prevent breaking url with chars like #, <. - fixes #5672 --- rhodecode/lib/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py index 5d586b02..7b454ecb 100644 --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -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'