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,
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;
}
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
[% USE Bugzilla %]
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
- [% error_message FILTER none %]
+ [% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
+ [% error_message FILTER none %]
+ [% ELSE %]
+ [% error_message FILTER txt %]
+ [% END %]
[% RETURN %]
[% END %]
[%# 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 %]
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
[% USE Bugzilla %]
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
- [% error_message FILTER none %]
+ [% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
+ [% error_message FILTER none %]
+ [% ELSE %]
+ [% error_message FILTER txt %]
+ [% END %]
[% RETURN %]
[% END %]