Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
6c0f16ff
Commit
6c0f16ff
authored
Sep 22, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 351994: Messages shouldn't contain HTML characters unless we're in USAGE_MODE_BROWSER
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=ghendricks, a=myk
parent
c4840b68
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
2 deletions
+26
-2
Template.pm
Bugzilla/Template.pm
+16
-0
008filter.t
t/008filter.t
+1
-1
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+4
-0
message.txt.tmpl
template/en/default/global/message.txt.tmpl
+1
-1
user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+4
-0
No files found.
Bugzilla/Template.pm
View file @
6c0f16ff
...
...
@@ -760,6 +760,22 @@ sub create {
1
],
# Note that using this filter is even more dangerous than
# using "none," and you should only use it when you're SURE
# the output won't be displayed directly to a web browser.
txt
=>
sub
{
my
(
$var
)
=
@_
;
# Trivial HTML tag remover
$var
=~
s/<[^>]*>//g
;
# And this basically reverses the html filter.
$var
=~
s/\@/@/g
;
$var
=~
s/\</</g
;
$var
=~
s/\>/>/g
;
$var
=~
s/\"/\"/g
;
$var
=~
s/\&/\&/g
;
return
$var
;
},
# Wrap a displayed comment to the appropriate length
wrap_comment
=>
\&
Bugzilla::Util::
wrap_comment
,
...
...
t/008filter.t
View file @
6c0f16ff
...
...
@@ -225,7 +225,7 @@ sub directive_ok {
return
1
if
$directive
=~
/
FILTER
\
(
html
|
csv
|
js
|
base64
|
url_quote
|
css_class_quote
|
ics
|
quoteUrls
|
time
|
uri
|
xml
|
lower
|
obsolete
|
inactive
|
closed
|
unitconvert
|
none
)
\
b
/
x
;
txt
|
none
)
\
b
/
x
;
return
0
;
}
...
...
template/en/default/global/code-error.html.tmpl
View file @
6c0f16ff
...
...
@@ -434,7 +434,11 @@
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
[% USE Bugzilla %]
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
[% error_message FILTER none %]
[% ELSE %]
[% error_message FILTER txt %]
[% END %]
[% RETURN %]
[% END %]
...
...
template/en/default/global/message.txt.tmpl
View file @
6c0f16ff
...
...
@@ -23,4 +23,4 @@
[%# Yes, this may show some HTML. But it's the best we
# can do at the moment. %]
[% PROCESS global/messages.html.tmpl %]
[% message %]
[% message
FILTER txt
%]
template/en/default/global/user-error.html.tmpl
View file @
6c0f16ff
...
...
@@ -1483,7 +1483,11 @@
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
[% USE Bugzilla %]
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
[% error_message FILTER none %]
[% ELSE %]
[% error_message FILTER txt %]
[% END %]
[% RETURN %]
[% END %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment