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 { ...@@ -532,6 +532,7 @@ sub create {
# See bugs 4928, 22983 and 32000 for more details # See bugs 4928, 22983 and 32000 for more details
html_linebreak => sub { html_linebreak => sub {
my ($var) = @_; my ($var) = @_;
$var = html_quote($var);
$var =~ s/\r\n/\
/g; $var =~ s/\r\n/\
/g;
$var =~ s/\n\r/\
/g; $var =~ s/\n\r/\
/g;
$var =~ s/\r/\
/g; $var =~ s/\r/\
/g;
......
...@@ -226,7 +226,7 @@ sub directive_ok { ...@@ -226,7 +226,7 @@ sub directive_ok {
return 1 if $directive =~ /FILTER\ (html|csv|js|base64|url_quote|css_class_quote| return 1 if $directive =~ /FILTER\ (html|csv|js|base64|url_quote|css_class_quote|
ics|quoteUrls|time|uri|xml|lower|html_light| ics|quoteUrls|time|uri|xml|lower|html_light|
obsolete|inactive|closed|unitconvert| obsolete|inactive|closed|unitconvert|
txt|none)\b/x; txt|html_linebreak|none)\b/x;
return 0; return 0;
} }
......
...@@ -540,7 +540,7 @@ ...@@ -540,7 +540,7 @@
</table> </table>
<p>Traceback:</p> <p>Traceback:</p>
<pre>[% traceback FILTER html FILTER html_linebreak %]</pre> <pre>[% traceback FILTER html_linebreak %]</pre>
[% IF variables %] [% IF variables %]
<pre> <pre>
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
[% ELSE %] [% ELSE %]
[% FOREACH mvalue = cgi.param(field).slice(0) %] [% FOREACH mvalue = cgi.param(field).slice(0) %]
<input type="hidden" name="[% field FILTER html %]" <input type="hidden" name="[% field FILTER html %]"
value="[% mvalue FILTER html FILTER html_linebreak %]"> value="[% mvalue FILTER html_linebreak %]">
[% END %] [% END %]
[% END %] [% 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