From 485dc6b8e817ebb2eb131181baa6c69b6e3fa75e Mon Sep 17 00:00:00 2001 From: Max Magorsch Date: Wed, 6 May 2020 23:41:03 +0200 Subject: Add user error message for illegal html attachments Signed-off-by: Max Magorsch --- extensions/AttachmentFilter/Extension.pm | 1 + template/en/default/global/user-error.html.tmpl | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/AttachmentFilter/Extension.pm b/extensions/AttachmentFilter/Extension.pm index 1d316901e..a56f7ca77 100644 --- a/extensions/AttachmentFilter/Extension.pm +++ b/extensions/AttachmentFilter/Extension.pm @@ -23,6 +23,7 @@ sub attachment_process_data { ${$args->{data}} = ''; $args->{attributes}->{filename} = ''; + ThrowUserError("illegal_html_attachment"); } __PACKAGE__->NAME; diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index cc1ad1994..63655b926 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -903,7 +903,11 @@ [% title = "Unauthorized Action" %] You are not authorized to edit attachments on [% terms.bug %] [%+ bug_id FILTER html %]. - + + [% ELSIF error == "illegal_html_attachment" %] + [% title = "Unauthorized Action" %] + You are not authorized to add html attachments. + [% ELSIF error == "illegal_bug_status_transition" %] [% title = "Illegal $terms.Bug Status Change" %] [% IF old.defined %] -- cgit v1.2.3-65-gdbad