branch-permissions: protect from XSS on branch rules forbidden flash message.

This commit is contained in:
Marcin Lulek 2020-07-07 15:29:17 +02:00
parent 479e568a61
commit 217cb4defc

View file

@ -125,7 +125,7 @@ class RepoFilesView(RepoAppView):
self.db_repo_name, branch_name)
if branch_perm and branch_perm not in ['branch.push', 'branch.push_force']:
message = _('Branch `{}` changes forbidden by rule {}.').format(
h.escape(branch_name), rule)
h.escape(branch_name), h.escape(rule))
h.flash(message, 'warning')
if json_mode: