Messages shouldn't contain HTML characters unless we're in USAGE_MODE_BROWSER

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
Bugzilla-General
--
enhancement
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

2.23
Bugzilla 3.0
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

v2
4.08 KB, patch
Greg Hendricks
: review+
Details | Diff | Splinter Review
(Assignee)

Description

12 years ago
Right now, message.txt.tmpl and all of the Throw*Error functions can display various HTML (as part of the message itself). We should be able to strip out HTML and reverse entities for XML-RPC, email, and the command line.
(Assignee)

Comment 1

12 years ago
Created attachment 237559 [details] [diff] [review]
v1

Okay, here we go. I tested this and it works.
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #237559 - Flags: review?(wurblzap)

Comment 2

12 years ago
Comment on attachment 237559 [details] [diff] [review]
v1

>Index: Bugzilla/Template.pm

>+            txt => sub {

>+                # And this basically reverses the html filter.

Wouldn't it be better to hack the 'html' filter so that it doesn't HTML-escape strings when USAGE_MODE_BROWSER is not in use?
(Assignee)

Comment 3

12 years ago
(In reply to comment #2)
> Wouldn't it be better to hack the 'html' filter so that it doesn't HTML-escape
> strings when USAGE_MODE_BROWSER is not in use?

  No. That doesn't work. The messages are actually *written* in HTML, and they have to have their HTML stripped. :-)

  I did think of that at first though. I tried it and it was ineffective.

(Assignee)

Updated

12 years ago
Attachment #237559 - Flags: review?(wurblzap) → review?(LpSolit)
(Assignee)

Comment 4

12 years ago
Created attachment 239572 [details] [diff] [review]
v2

I would really like this reviewed before we release 2.23.3.
Attachment #237559 - Attachment is obsolete: true
Attachment #239572 - Flags: review?(ghendricks)
Attachment #237559 - Flags: review?(LpSolit)

Comment 5

12 years ago
Comment on attachment 239572 [details] [diff] [review]
v2

This will be useful for importxml as well. 

This looks good.
Attachment #239572 - Flags: review?(ghendricks) → review+
(Assignee)

Updated

12 years ago
Flags: approval?
Flags: approval? → approval+
(Assignee)

Comment 6

12 years ago
Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.63; previous revision: 1.62
done
Checking in t/008filter.t;
/cvsroot/mozilla/webtools/bugzilla/t/008filter.t,v  <--  008filter.t
new revision: 1.25; previous revision: 1.24
done
Checking in template/en/default/global/code-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/code-error.html.tmpl,v  <--  code-error.html.tmpl
new revision: 1.87; previous revision: 1.86
done
Checking in template/en/default/global/message.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/message.txt.tmpl,v  <--  message.txt.tmpl
new revision: 1.3; previous revision: 1.2
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v  <--  user-error.html.tmpl
new revision: 1.190; previous revision: 1.189
done
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.