Commit 401b0d13 authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 565899: Make the html_linebreak filter safe by having it first call the

"html" filter r=LpSolit, a=LpSolit
parent 4095f067
......@@ -532,6 +532,7 @@ sub create {
# See bugs 4928, 22983 and 32000 for more details
html_linebreak => sub {
my ($var) = @_;
$var = html_quote($var);
$var =~ s/\r\n/\
/g;
$var =~ s/\n\r/\
/g;
$var =~ s/\r/\
/g;
......
......@@ -226,7 +226,7 @@ sub directive_ok {
return 1 if $directive =~ /FILTER\ (html|csv|js|base64|url_quote|css_class_quote|
ics|quoteUrls|time|uri|xml|lower|html_light|
obsolete|inactive|closed|unitconvert|
txt|none)\b/x;
txt|html_linebreak|none)\b/x;
return 0;
}
......
......@@ -540,7 +540,7 @@
</table>
<p>Traceback:</p>
<pre>[% traceback FILTER html FILTER html_linebreak %]</pre>
<pre>[% traceback FILTER html_linebreak %]</pre>
[% IF variables %]
<pre>
......
......@@ -52,7 +52,7 @@
[% ELSE %]
[% FOREACH mvalue = cgi.param(field).slice(0) %]
<input type="hidden" name="[% field FILTER html %]"
value="[% mvalue FILTER html FILTER html_linebreak %]">
value="[% mvalue FILTER html_linebreak %]">
[% END %]
[% END %]
[% END %]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment